🏁 Start VirtualBox VM in Headless Mode

• 1 min read

It is fairly common in web development to run code in a virtual machine (VM) so that you can mirror your production environment. However, using a GUIless operating system through VirtualBox’s GUI window is a terrible experience. Fortunately VirtualBox provides an easy way of starting a VM using their command line tool VBoxManage in a headless mode.

# List virtual machines
VBoxManage list vms
"MyVM" {e4b0c92c-4301-4a7d-8af8-fe02fed00451}

# Start VM in headless mode
VBoxManage startvm MyVM --type headless

# Power off VM
VBoxManage controlvm MyVM poweroff

Once the virtual machine has started you can connect to it over SSH and use it as you would any server operating system.

If you enjoyed this tutorial, please consider sponsoring my work on GitHub 🤗

Now look what you've done 🌋
Stop clicking and run for your life! 😱
Uh oh, I don't think the system can't handle it! 🔥
Stop it, you're too kind 😄
Thanks for the love! ❤️
Thanks, glad you enjoyed it! Care to share?
Hacker News Reddit

×

Recommended Posts ✍🏻

See All »
• 3 min read
✨ HTML Share Buttons
Read Post »
• 8 min read
🚜 A Simple Web Scraper in Go
Read Post »
• 4 min read
💻 Wait for User to Stop Typing, in JavaScript
Read Post »