Remote Job Launching via ICE with VirtualBox VMs
Contents
Introduction
This guide will walk you through how to set up a VirtualBox virtual machine (VM) running Fedora Linux—running on top of a Mac OS X host—to use as a compute resource during remote job launches. Other flavors of Linux may require slightly different steps.
Prerequisites
The user must have ICE and its associated dependencies installed before moving forward. See Getting ICE for more details.
The user must also install a VM software. Oracle's VirtualBox is used for this tutorial. See the VirtualBox download page for more details.
The VM itself also requires an operating system, and the Fedora Linux distribution was installed on the VM for the purpose of this tutorial.
On the Host Machine
Linux/MacOS Hosts
First, add yourself to the vboxusers group. Run the following line in a terminal:
sudo usermod -aG vboxusers <your username>
You may have to add vboxdrv, vboxnetadp, vboxflt to your kernel modules. To do so you will create a new file in /etc/modprobe.d
. Use the following commands to do so:
sudo nano /etc/modprobe.d/virtualbox
Then use ctrl+shift+v
to paste the following lines into the file:
vboxdrv vboxnetadp vboxflt
Once done press ctrl+x
then y
to save the file. Once this step is complete, reboot your system.
When you have rebooted you can start VirtualBox, but do not yet start your VM. Navigate to File > Preferences > Network > Host Only
and hit the add button. This should add a network named vboxnet0
. To check if this worked, open a terminal and check that vboxnet0
is in the output of the command ifconfig
. Now in VirtualBox highlight the VM and go to Settings > Network > Adapter 2 > Host-Only vboxnet0
.
Now you can start your VM and proceed to the Inside the VM section.
Windows Hosts
Start VirtualBox, but not the VM. Select your VM from the list and go to Settings > Network > Adapter 2
and select Bridged Adapter from the list. Start the VM and proceed to the next section.
Inside the VM
Once you have your host OS set up and your VM started up you can open a terminal to finish the setup.
If you do not have a password set up do so with:
passwd
You will also have to make sure that you have `sshd` running on the VM. To do so on Fedora issue the command:
sudo systemctl enable sshd.service
Then, you will need to determine the ip address that will be used to connect from the host to the VM. To find this out issue the command:
ifconfig
The output will look something similar to the following:
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 0 (Local Loopback) RX packets 14 bytes 1400 (1.3 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 14 bytes 1400 (1.3 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 p2p1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255 inet6 fe80::a00:27ff:fe71:e5d2 prefixlen 64 scopeid 0x20<link> ether 08:00:27:71:e5:d2 txqueuelen 1000 (Ethernet) RX packets 21 bytes 2844 (2.7 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 39 bytes 6216 (6.0 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 p7p1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.56.101 netmask 255.255.255.0 broadcast 192.168.56.255 inet6 fe80::a00:27ff:febd:8a04 prefixlen 64 scopeid 0x20<link> ether 08:00:27:bd:8a:04 txqueuelen 1000 (Ethernet) RX packets 3 bytes 1240 (1.2 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 22 bytes 4730 (4.6 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
The ip address you want is listed next to inet
on the last entry.
For Windows Hosts
There is an additional step for those running a Windows host. In your VM terminal issue these two commands:
sudo dhclient -r sudo dhclient
And then reboot the VM.
Back on the Host Machine
Finally, on your host machine (while you still have the VM active) open ICE and prepare your favorite job. When you have reached the job launch phase you can enter the ip address that was found in the previous section under the hostname section of the launcher form. When you go to launch the job you will be prompted to enter the username and password for the VM. Do so and your job will be launched on the VM. Once the job is complete the relevant data will automatically be passed back to your host machine via ICE.