Nifty Virtualbox Commands
TL;DR
Here are some nifty VirtualBox commands I just want to have for reference 😇
List the VirtualBoxes on your machine:
|
|
Start your VirtualBox in headless mode (i.e. no UI):
|
|
List all of your running VirtualBoxes:
|
|
List the IP address of the VirtualBox:
|
|
The Rest of the Story
Do you have a desktop or laptop that you use for running VirtualBoxes? I’m not talking about a virtual machine server, just a beefed-up PC that runs some of your VirtualBoxes. And what happens if you are remote, and all you can do is SSH into that PC, how do you start your VirtualBoxes?
Well, if this sounds familiar, here are some nifty commands to start up your VirtualBoxes remotely.
I am assuming that you have connected to a remote PC using something like Secure Shell Protocol (SSH). You can run these commands locally as well, but my use case is with a remote PC.
I am also assuming that your VirtualBox, the one you want to start up remotely, has remote-connection software set up on it as well. Maybe SSH, or if it is a Windows VirtualBox, then Remote Desktop (RDP).
For starters, I can never seem to remember all the names of my VirtualBoxes, so let’s begin by listing the VirtualBoxes on our machine:
|
|
You should then see the VirtualBox names listed:
|
|
Next you’ll want to start one of your VirtualBoxes. To do that, run this command:
|
|
It is important to use --type headless
here, otherwise the VirtualBox will not start unless you have the VirtualBox GUI running.
Using my list of VirtualBoxes, my command would look like this:
|
|
Thirdly, you can use this command to see if the VirtualBox is running:
|
|
If you have a static IP address assigned to your VirtualBox, you can skip this. But if you do not, this command will list the IP address of the VirtualBox:
|
|
Again, using my VirtualBox’s name, the command would be:
|
|
And the results, will look something like this:
|
|
Conclusion
You should now be able to connect to your remotely-started VirtualBox.
End of Line.