While for regular use one might setup a headless VM with RDP and/or SSH running on the VM itself, this procedure is for connecting to a virtual machine on a remote PC.
- Remote: VirtualBox install of guest operating system
apt install xfreerdp-x11
on your local laptop, create a script
#!/bin/bash set -e ssh -f -L 5930:localhost:5930 firstname.lastname@example.org sleep 1; xfreerdp /u:VMusername /v:localhost:5930
Optionally, add a few simple FreeRDP options to enhance performance, especially on limited data bandwidth connections
Most people can get by with this, and don’t need the alternative command line option.
- establish a VNC connection over SSH
if you use the very basic OpenBox desktop environment, open a Terminal on the remote PC by right clicking anywhere on the remote desktop and type
the usual VirtualBox program should open
from the right dropdown menu of the right arrow “start” button on the main VirtualBox window on the remote VNC PC, click
headless. The status of the VM will show “Running”.
connect from your laptop with a script
when done, shutdown your VM as usual if desired.
Most can use the GUI method above, but VirtualBox can also be managed well via shell commands.
virtualbox vmstart MyVMName --headless
starts up the VM named “MyVMName” for example.
Numerous headless options exist for low server resource utilization via VBoxManage CLI.