Run a VirtualBox Virtual Machine from an Ubuntu Server shell with no GUI?

Discussions related to using VirtualBox on Linux hosts.
Post Reply
RocketNuts
Posts: 4
Joined: 11. Jul 2018, 06:27

Run a VirtualBox Virtual Machine from an Ubuntu Server shell with no GUI?

Post by RocketNuts »

I have a server running Ubuntu Server 19.10 with no GUI and no screen attached. I only connect to it through SSH.

Is it possible to install VirtualBox on there and run a Virtual Machine that does have its own (virtual) screen, even though the screen isn't displayed or outputted anywhere by the host machine?

For example I want to run a Windows 10 Virtual Machine. I want to launch it from the shell, and I will then interact with it using VirtualBox's CLI/API functionality to send keyboard & mouse commands, grab screenshots, etc.

Obviously the Windows instance in the Virtual Machine will need to think it has a screen, whereas in reality it's running in a command-line-only host environment where the screen cannot be shown.

If necessary I could first create and setup the VM elsewhere. For example on an Ubuntu Desktop PC where I do have a GUI so I can interact visually. But once I have a fully installed and working VM, I'd want to copy the files to the Ubuntu Server and run it from there.

Is this possible, and if yes, how?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Run a VirtualBox Virtual Machine from an Ubuntu Server shell with no GUI?

Post by scottgus1 »

It should be possible. Virtualbox is installable via the command line, and the vboxmanage commands can adjust every setting that the Virtualbox GUI can do, and more. You could go for the full command-line 'religious experience', or build a guest to the point of starting the install on a GUI-desktop PC then move the guest to the no-GUI host. The guest's video system is virtual, so there should be a full guest GUI calculated. Depending on host capabilities, you might not have 3D acceleration available for the guest. Use the Virtualbox RDP server or guest-local remote software to see the guest GUI on another PC.
Post Reply