Skip to content

Instantly share code, notes, and snippets.

@prehensilecode
Last active October 18, 2019 02:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prehensilecode/236be151935fc57c94538b5f51e98664 to your computer and use it in GitHub Desktop.
Save prehensilecode/236be151935fc57c94538b5f51e98664 to your computer and use it in GitHub Desktop.
VirtualBox commandline cheat sheet
# start a guest in headless mode
vboxmanage startvm guestvmname --type headless
# add a nic (number 2) to guest, setting it to be on the host-only network, and make it a virtio device
vboxmanage modifyvm guestvmname --nic2 hostonly --nictype2 virtio --hostonlyadapter2 vboxnet0
# remove nic number 2
vboxmanage modifyvm guestvmname --nic2 none
# turn on host i/o cache - needed for the virtual disk on ext4 on older kernels
vboxmanage storagectl guestvmname --name SATA --hostiocache on
# enable dhcp server on the host-only network
vboxmanage dhcpserver add --ifname vboxnet0 --ip 192.168.56.1 --netmask 255.255.255.0 --lowerip 192.168.56.11 --upperip 192.168.56.200 --enable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment