Month: March 2022

VirtualBox Command Line Interface

VirtualBox Command Line

List all VMs

vboxmanage list vms

List all running VMs

vboxmanage list runningvms

Show a VM info

vboxmanage showvminfo <name or UUID>.

Start a VM

vboxmanage startvm <name or UUID>.

Control a VM

vboxmanage controlvm <subcommand>

Subcommand: pause, resume, reset, poweroff, and savestate

Unregister a VM

vboxmanage unregister <name or UUID>

Remove a VM

vboxmanage unregister --delete <name or UUID>

Modify a VM

vboxmanage modifyvm <name or UUID> --name <new name>
vboxmanage modifyvm <name or UUID> --description <new description>.
vboxmanage modifyvm <name or UUID> --memory <RAM in MB>.
vboxmanage modifyvm <name or UUID> --cpus <number>.

Change VM state

vboxmanage controlvm <name or UUID> setlinkstate<num> [off|on]
vboxmanage modifyvm <name or UUID> --nicpromisc<num> allow-all
vboxmanage controlvm nic<num> <network type>

Note: The <num> is referring to eth<num> interface. The Network type can be hostonly, etc.

References

An Introduction to the VirtualBox CLI

Install Vagrant on CentOS in Proxmox

Install Vagrant on CentOS

Steps

Check version

The latest version of Vagrant can be found in https://releases.hashicorp.com/vagrant.

Install

yum install https://releases.hashicorp.com/vagrant/2.2.19/vagrant_2.2.19_x86_64.rpm

Verify

vargant --version

Init CentOS 7 with Vagrant

sudo mkdir ~/vagrant-centos-7
cd ~/vagrant-centos-7
vagrant box add centos/7

Create Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "centos/7"
end

Start Vagrant

vagrant up

SSH

vagrant ssh

Halt Vagrant

vagrant halt

Destroy Vagrant

vagrant destroy

Troubleshooting

If the following error appeared, change the CPU type of CentOS VM in Proxmox to host.

Stderr: VBoxManage: error: VT-x is not available (VERR_VMX_NO_VMX)

References

How to Install Vagrant on CentOS 7
centos/8 Vagrant box

Manage VMware Fusion via `vmrun`

Manage VMware Fusion via vmrun

Start VMware Fusion

$ open -a "VMware Fusion"

List running VM

vmrun list

Start a VM

vmrun start <vm_name>.vmx

Troubleshooting

Hanging at VM starting up

This could be caused by some warning message appears on the screen.

References

Examples of vmrun Commands
How to Open Applications Using Terminal on Mac

Enable VMmotion in VMware

Enable VMmotion in VMware

Two ESXi servers, for example esx01 and esx02.

CPU

The CPU of both esx01 and esx02 are same family.

Storage

Both esx01 and esx02 are having same shared storage.

Configure

Configure NFS or iSCSI in both ESXi servers.

Verify

Access storage, and check Hosts tab, both ESXi servers should be in the list.

Network

Add VMkernel Network Adapter with vMotion service, can be on an existing standard switch.

References

VMware Tutorial No.45 | VMware vMotion Step by Step |vMotion in VMware 6.7 |vSphere vMotion GOVMLAB

Install VMware vSphere 7.0 on Proxmox

Install VMware vSphere 7.0 on Proxmox

Verify

root@proxmox:~# cat /sys/module/kvm_intel/parameters/nested
Y

Enable

Intel CPU

echo "options kvm-intel nested=Y" > /etc/modprobe.d/kvm-intel.conf

AMD CPU

echo "options kvm-amd nested=1" > /etc/modprobe.d/kvm-amd.conf

Install Module

modprobe -r kvm_intel
modprobe kvm_intel

Note: more info, check https://pve.proxmox.com/wiki/Nested_Virtualization

Install

ISO

Download ISO, such as VMware-VMvisor-Installer-7.0U2a-17867351.x86_64.iso

VM Configure

  • General Tab

    • Name:
  • OS Tab

    • Type: Linux
    • Version: 5.x – 2.6 Kernel
  • System Tab

    • Graphic card: Default
    • SCSI Controller: VMware PVSCSI
    • BIOS: SeaBIOS (OVMF (UEFI) should work too)
    • Machine: q35
  • Hard Disk Tab

    • Bus/Device: SATA
    • Disk size (GiB): 16
  • CPU Tab

    • Cores: 4 (At least 2, 4 will be better if our physical CPU has enough cores)
    • Type: host (or Default (kvm64))
    • Enable NUMA: Check (if possible)
  • Memory Tab

    • Memory (MiB): 4096 (At least 4096, better if assign more)
    • Ballooning Device: Uncheck
  • Network Tab

    • Model: VMware vmxnet3

References

Nested Virtualization
How to Install/use/test VMware vSphere 7.0 (ESXi 7.0) on Proxmox VE 6.3-3 (PVE)