Skip to main content
Jump to: navigation, search

Remote Job Launching via ICE with VirtualBox VMs

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/Mac OS X Hosts

First, add yourself to the vboxusers group by executing the following line in a terminal:

sudo usermod -aG vboxusers <your username>

You may have to add vboxdrv, vboxnetadp, and vboxflt to your kernel modules. To do so you will create a new file in /etc/modprobe.d using the following commands:

sudo nano /etc/modprobe.d/virtualbox

Then use the ctrl + shift + v key combination 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 host system.

Adding Virtual Network

Once the host system has rebooted, start VirtualBox, but do not start the VM.

Instead, in VitualBox's main menu, navigate to File > Preferences to enter the preferences dialog.

ICE VM virtual-box-settings stc.png

From here, select the Network box and then select the Host-Only Networks button. Finally, click Add (stylized as a "+") to add a new host-only network.

ICE VM add-adapter stc.png

This action should add a network named vboxnet0. To confirm, execute ifconfig in a terminal and check that vboxnet0 is listed in the output of the command. The output should be similar to this:

vboxnet0: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	ether 0a:00:27:00:00:00

Select the Virtual Network

Back in VirtualBox, right click your VM and click Settings to enter the settings dialog.

ICE VM settings stc.png

From here, select the Network box and then the Adapter 2 tab. Enable Adapter 2 by selecting the checkbox as shown below.

ICE VM adapter2 2 stc.png

Select Host-only Adapter from the first combo box. Then select vboxnet0 from the second combo box and click OK.

Now you can start your VM and proceed to the Inside the VM section.

Windows Hosts

Start VirtualBox, but not the VM. Right click your VM and click Settings to enter the settings dialog.

From here, select the Network box and then the Adapter 2 tab. Enable Adapter 2 by selecting the checkbox.

Select Bridged Adapter from the combo box. Then select your desired network adapter and click OK.

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.

Back to the top