On 10/05/2013 12:46 PM, 6tr6tr wrote:
>
> Is there a way to put a bunch of virtual machines (preferably
> VirtualBox) on a server on my local network and then from my laptop:
>
>
>
> - Be able to turn on the virtual machine
> - Be able to interact with it and see it as though it were being run
> on my laptop
>
>
> Both computers would be running linux (openSUSE on laptop and server
> might be openSUSE or Ubuntu).
I have no idea what you would do with an Ubuntu host, but in the case of
openSUSE, I have the following file that can be executed by root:
#Edit these variables!
VMUSER=finger
VMNAME=“openSUSE 12.2 32-bit”
case “$1” in
start)
echo “Starting VirtualBox VM…”
sudo -u $VMUSER /usr/bin/VBoxManage startvm “$VMNAME” --type headless
;;
stop)
echo “Saving state of Virtualbox VM…”
sudo -u $VMUSER /usr/bin/VBoxManage controlvm “$VMNAME” savestate
;;
*)
echo “Usage: /etc/init.d/StartVM {start|stop}”
exit 1
;;
esac
exit 0
I also have links in /etc/init.d/rc5.d/ named K01StartVM and S13StartVM that
point to the above file.
When the host boots, the VM is started. The VM uses bridged networking and a
fixed IP address. I can access that VM using ‘ssh -X <IP Address>’ from any
machine in my network. This particular VM is used when I need a 32-bit
architecture for testing.