Day: March 23, 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