Skip to content

VMware Fusion

Richard Spindler edited this page Sep 29, 2020 · 1 revision

Some example commands to do various operations on VMware Fusion VMs

Configure VMware Fusion network

./modest.rb --action check --vm fusion

Creating Kickstart (CentOS, Scientific, RedHat Enterprise, Fedora, Oracle Enterprise) VMware Fusion VM examples:

./modest.rb --action create --method kickstart --vm fusion --client centos510vm01 --arch x86_64 --mac 00:50:56:34:4E:7A
./modest.rb --action create --os-type centos --vm fusion  --client centos510vm01 --arch x86_64 --mac 00:50:56:34:4E:7A

Create Preseed (Ubuntu, Debian) Linux VMware Fusion VM:

./modest.rb --action create --method preseed --vm fusion --name ubuntu1310vm01 --arch x86_64 -mac 08:00:27:BA:34:7C
./modest.rb --action create --os-type ubuntu --vm fusion --name ubuntu1310vm01 --arch x86_64 -mac 08:00:27:BA:34:7C

Create AutoYast (SuSE, OpenSuSE) Linux VMware Fusion VM:

./modest.rb --action create --method autoyast --vm fusion --name sles11sp2vm01 --arch x86_64 --mac 08:00:27:BA:34:7D
./modest.rb --action create --os-type sles --vm fusion --name sles11sp2vm01 --arach x86_64 --mac 08:00:27:BA:34:7D

Create Jumpstart (Solaris 2.6 - 10) VMware Fusion VM:

./modest.rb --action create --method jumpstart --vm fusion --name sol10u11vm01 --arch i386 --mac 00:0C:29:FA:0C:7F
./modest.rb --action create --os-type solaris --release 10 --vm fusion --name sol10u11vm01 --arch i386 --mac 00:0C:29:FA:0C:7F

Create AI (Solaris 11) VMware Fusion VM:

./modest.rb --action create --method ai --vm fusion --name sol11u01vm03 --mac 00:50:56:26:92:D8
./modest.rb --action create --os-type solaris --release 11 --vm fusion --name sol11u01vm03 --mac 00:50:56:26:92:D8

Create vSphere (ESXi) VMware Fusion VM:

./modest.rb --action create --method vsphere --vm fusion --name vmware55vm01 --mac 00:50:56:26:92:D8
./modest.rb --action create --os-type vsphere --vm fusion --name vmware55vm01 --mac 00:50:56:26:92:D8

Create Windows VMware Fusion VM:

./modest.rb --action create --method windows --vm fusion --name win2008r2vm01 --mac 08:00:27:61:B7:AF

Create OpenBSD VMware Fusion VM:

./modest.rb --action create --os-type openbsd --name openbsd55vm01 --mac 08:00:27:61:B7:AA
./modest.rb --action create --method bsd --name openbsd55vm01 --mac 08:00:27:61:B7:AA

Create NetBSD VMware Fusion VM:

./modest.rb --action create --os-type netbsd --name netbsd10vm01 --mac 08:00:27:61:B7:AA
./modest.rb --action create --method bsd --name netbsd10vm01 --mac 08:00:27:61:B7:AA

Delete Kickstart (CentOS, Scientific, RedHat Enterprise, Fedora, Oracle Enterprise) Linux VMware Fusion VM:

./modest.rb --action delete --vm fusion --name centos510vm01

Delete Jumpstart (Solaris 2.6 - 10) VMware Fusion VM:

./modest.rb --action delete --vm fusion --name sol10u11vm01

Delete AI (Solaris 11) VMware Fusion VM:

./modest.rb --action delete --vm fusion --name sol11u01vm03

Delete vSphere (ESXi) VMware Fusion VM:

./modest.rb --action delete --vm fusion --name vmware55vm01

Boot headless Linux VMware Fusion VM:

./modest.rb --action boot --vm fusion --name centos510vm01 --console headless

Boot headless serial enabled Linux VMware Fusion VM:

./modest.rb --action boot --vm fusion --name centos510vm01 --console serial

Restart a VMware Fusion VM:

./modest.rb --action restart --vm fusion --name centos510vm0

Boot non headless (default boot mode) Linux VMware Fusion VM:

./modest.rb --action boot --vm fusion --name centos510vm01
./modest.rb --action boot --vm fusion --name centos510vm01 --console text

Halt/Pause Linux VMware Fusion VM:

./modest.rb --action halt --vm fusion --name centos510vm01
./modest.rb --action pause --vm fusion --name centos510vm01

Boot Windows VMware Fusion VM:

./modest.rb --action boot --vm fusion --name win2008r2vm01

Stop Windows VMware Fusion VM:

./modest.rb --action stop --vm fusion --name win2008r2vm01

Resume Windows VMware Fusion VM:

./modest.rb --action resume --vm fusion --name win2008r2vm01

Modify VMware Fusion VM MAC Address:

./modest.rb --action modify --vm fusion --name centos510vm01 --mac 00:50:56:34:4E:7A
./modest.rb --action change --vm fusion --name centos510vm01 --mac 00:50:56:34:4E:7A

Attach CDROM to VMware Fusion VM:

./modest.rb --action attach --vm fusion --name sol11u2vm01 --file /isos/sol-11_2-text-x86.iso

Detach CDROM to VMware Fusion VM:

./modest.rb --action detach --vm fusion --name sol11u2vm01

Snapshot a VMware Fusion VM:

./modest.rb --action snapshot --vm fusion --name sol11u02vm01

List VMware Fusion VM snapshots:

./modest.rb --action list --type snapshot  --vm fusion --name sol11u02vm01

Show VMware Fusion VM information:

./modest.rb --action show --vm fusion --name sol11u03vb01

Set VMware Fusion VM Parameter:

./modest.rb --action set --vm fusion --param numvcpus --value 2 --name sol11u03vb01

Get VMware Fusion VM Parameter:

./modest.rb --action get --vm fusion --param numvcpus --name sol11u03vb01

Some examples for creating VMs:

./modest.rb --action create --method vsphere --vm fusion --name vmware60vm01 --mac 00:50:56:26:92:D8 --verbose
Information:	Runing in verbose mode
Setting:	Client name to: vmware60vm01
Information:	Setting client MAC address to: 00:50:56:26:92:D8
Information:	Setting VM network to: hostonly
Information:	Home directory /Users/spindler
Information:	Setting work directory to /Users/spindler/.mode
Information:	Setting temporary directory to /Users/spindler/.mode
Determining:	Default host IP
Executing:	sudo sh -c 'ifconfig en0 |grep 'inet ' |awk '{print $2}''
Information:	Setting VM type to fusion
Information:	Setting console mode to: text
Information:	Setting model to: 
Determining:	VMware Version
Executing:	defaults read "/Applications/VMware Fusion.app/Contents/Info.plist" CFBundleShortVersionString
Output:		7.1.1
Information:	VMware Fusion VM vmware60vm01 configuration:
.encoding = "UTF-8"
config.version = "8"
virtualHW.version = "11"
vcpu.hotadd = "TRUE"
scsi0.present = "TRUE"
scsi0.virtualDev = "lsilogic"
memsize = "1024"
mem.hotadd = "TRUE"
scsi0:0.present = "TRUE"
scsi0:0.fileName = "vmware60vm01.vmdk"
ide0.present = "TRUE"
ide0:0.present = "TRUE"
ide0:0.deviceType = "cdrom-raw"
ide0:0.filename = ""
ide0:0.startConnected = "TRUE"
ide0:0.autodetect = "TRUE"
sata0:1.present = "FALSE"
floppy0.fileType = "device"
floppy0.fileName = ""
floppy0.clientDevice = "FALSE"
ethernet0.present = "TRUE"
ethernet0.connectionType = "hostonly"
ethernet0.virtualDev = "e1000"
ethernet0.wakeOnPcktRcv = "FALSE"
ethernet0.addressType = "static"
ethernet0.linkStatePropagation.enable = "TRUE"
usb.present = "TRUE"
ehci.present = "TRUE"
ehci.pciSlotNumber = "35"
sound.present = "TRUE"
sound.fileName = "-1"
sound.autodetect = "TRUE"
mks.enable3d = "TRUE"
pciBridge0.present = "TRUE"
pciBridge4.present = "TRUE"
pciBridge4.virtualDev = "pcieRootPort"
pciBridge4.functions = "8"
pciBridge5.present = "TRUE"
pciBridge5.virtualDev = "pcieRootPort"
pciBridge5.functions = "8"
pciBridge6.present = "TRUE"
pciBridge6.virtualDev = "pcieRootPort"
pciBridge6.functions = "8"
pciBridge7.present = "TRUE"
pciBridge7.virtualDev = "pcieRootPort"
pciBridge7.functions = "8"
vmci0.present = "TRUE"
hpet0.present = "TRUE"
usb.vbluetooth.startConnected = "TRUE"
tools.syncTime = "TRUE"
displayName = "vmware60vm01"
guestOS = "vmkernel5"
nvram = "vmware60vm01.nvram"
virtualHW.productCompatibility = "hosted"
tools.upgrade.policy = "upgradeAtPowerCycle"
powerType.powerOff = "soft"
powerType.powerOn = "soft"
powerType.suspend = "soft"
powerType.reset = "soft"
extendedConfigFile = "vmware60vm01.vmxf"
uuid.bios = "56"
uuid.location = "56"
replay.supported = "FALSE"
replay.filename = ""
pciBridge0.pciSlotNumber = "17"
pciBridge4.pciSlotNumber = "21"
pciBridge5.pciSlotNumber = "22"
pciBridge6.pciSlotNumber = "23"
pciBridge7.pciSlotNumber = "24"
scsi0.pciSlotNumber = "16"
usb.pciSlotNumber = "32"
ethernet0.pciSlotNumber = "33"
sound.pciSlotNumber = "34"
vmci0.pciSlotNumber = "36"
sata0.pciSlotNumber = "37"
ethernet0.generatedAddressOffset = "0"
vmci0.id = "-1176557972"
vmotion.checkpointFBSize = "134217728"
cleanShutdown = "TRUE"
softPowerOff = "FALSE"
usb:1.speed = "2"
usb:1.present = "TRUE"
usb:1.deviceType = "hub"
usb:1.port = "1"
usb:1.parent = "-1"
checkpoint.vmState = ""
sata0:1.startConnected = "FALSE"
usb:0.present = "TRUE"
usb:0.deviceType = "hid"
usb:0.port = "0"
usb:0.parent = "-1"
ethernet0.address = "00:50:56:26:92:D8"
floppy0.present = "FALSE"
serial0.present = "TRUE"
serial0.fileType = "pipe"
serial0.yieldOnMsrRead = "TRUE"
serial0.startConnected = "TRUE"
serial0.fileName = "/tmp/vmware60vm01"
scsi0:0.redo = ""
monitor.virtual_mmu = "hardware"
monitor.virtual_exec = "hardware"
vhv.enable = "TRUE"
monitor_control.restrict_backdoor = "TRUE"
numvcpus = "2"
isolation.tools.hgfs.disable = "FALSE"
hgfs.mapRootShare = "TRUE"
hgfs.linkRootShare = "TRUE"
Creating:	VMware Fusion disk '/Users/spindler/Documents/Virtual Machines.localized/vmware60vm01.vmwarevm/vmware60vm01.vmdk' for vmware60vm01
Executing:	cd '/Users/spindler/Documents/Virtual Machines.localized/vmware60vm01.vmwarevm' ; '/Applications/VMware Fusion.app/Contents/Library/vmware-vdiskmanager' -c -s '12G' -a LsiLogic -t 1 '/Users/spindler/Documents/Virtual Machines.localized/vmware60vm01.vmwarevm/vmware60vm01.vmdk'
VixDiskLib: Invalid configuration file parameter. Failed to read configuration file.
Output:		Creating disk '/Users/spindler/Documents/Virtual Machines.localized/vmware60vm01.vmwarevm/vmware60vm01.vmdk'
Output:		Virtual disk creation successful.

Client:     vmware60vm01 created with MAC address 00:50:56:26:92:D8

Import a OVA file

./modest.rb --action create --vm fusion --file /Users/spindler/Documents/Cisco/Cisco_UCS_Platform_Emulator_3.0.1cPE1.ova --verbose --name ucsemu301cvm01
Information:	Runing in verbose mode
Setting:	Client name to: ucsemu301cvm01
Information:	Setting VM network to: hostonly
Information:	Home directory /Users/spindler
Information:	Setting work directory to /Users/spindler/.mode
Information:	Setting temporary directory to /Users/spindler/.mode
Determining:	Default host IP
Executing:	sudo sh -c 'ifconfig en0 |grep 'inet ' |grep -v inet6 |awk '{print $2}''
Information:	Setting VM type to fusion
Information:	Setting console mode to: text
Information:	Setting model to: 
Information:	Setting install file to: /Users/spindler/Documents/Cisco/Cisco_UCS_Platform_Emulator_3.0.1cPE1.ova
Information:	Setting install type to: ova
Warning:	Install method or OS not specified
Information:	Setting OS to other
Warning:	WMware configuration file for client does not exist
Information:	Importing VMware Fusion VM ucsemu301cvm01 from /Users/spindler/Documents/Virtual Machines.localized/ucsemu301cvm01.vmwarevm/ucsemu301cvm01.vmx
Executing:	"/Applications/VMware Fusion.app/Contents/Library/VMware OVF Tool/ovftool" --acceptAllEulas --name="ucsemu301cvm01" "/Users/spindler/Documents/Cisco/Cisco_UCS_Platform_Emulator_3.0.1cPE1.ova" "/Users/spindler/Documents/Virtual Machines.localized/ucsemu301cvm01.vmwarevm/ucsemu301cvm01.vmx"
Output:		Opening OVA source: /Users/spindler/Documents/Cisco/Cisco_UCS_Platform_Emulator_3.0.1cPE1.ova
Output:		The manifest validates
Output:		Opening VMX target: /Users/spindler/Documents/Virtual Machines.localized/ucsemu301cvm01.vmwarevm/ucsemu301cvm01.vmx
Output:		Writing VMX file: /Users/spindler/Documents/Virtual Machines.localized/ucsemu301cvm01.vmwarevm/ucsemu301cvm01.vmx
Transfer Completed                    
Output:		Completed successfully
Information:	Virtual Appliance /Users/spindler/Documents/Cisco/Cisco_UCS_Platform_Emulator_3.0.1cPE1.ova imported with VM name ucsemu301cvm01 and MAC address 36:3A:37:C9:C5:21
Clone this wiki locally