Remote console access to a VirtualBox VM running on Linux
Posted on Thu 08 September 2022 in Sysadmin
Assumptions:
- You have a remote Linux machine with a VirtualBox VM and you want to access the VM console remotely.
- The remote machine is named "vv000" and is accessible only via SSH.
- The VM is named "jammy"
Procedure:
- SSH to the remote machine where the VM is located.
-
Cleanly shut down the VM:
vboxmanage controlvm jammy acpipowerbutton
-
Configure the VirtualBox Remote Display:
vboxmanage modifyvm jammy --vrdeport 3390 vboxmanage modifyvm jammy --vrdeaddress 127.0.0.1 vboxmanage modifyvm jammy --vrdeauthtype null vboxmanage modifyvm jammy --vrdeextpack default vboxmanage modifyvm jammy --vrde on
-
Start the VM in headless mode:
vboxmanage startvm jammy -type headless
-
SSH again to the remote machine, this time port forwarding the RDP port:
ssh -L 3390:localhost:3390 you@vvv0000
-
On the local machine connect your RDP client to 127.0.0.1:3390