Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Remote Job Launching via ICE with VirtualBox VMs"

(Prerequisites)
(Linux/MacOS Hosts)
Line 11: Line 11:
 
== On the Host Machine ==
 
== On the Host Machine ==
 
----
 
----
=== Linux/MacOS Hosts ===
+
=== Linux/Mac OS X Hosts ===
First, add yourself to the vboxusers group.  Run the following line in a terminal:
+
First, add yourself to the vboxusers group by running the following line in a terminal:
<nowiki>sudo usermod -aG vboxusers <your username></nowiki>
+
<nowiki>sudo usermod -aG vboxusers <your username></nowiki>
  
You may have to add vboxdrv, vboxnetadp, vboxflt to your kernel modules. To do so you will create a new file in <code>/etc/modprobe.d</code>.  Use the following commands to do so:
+
You may have to add vboxdrv, vboxnetadp, and vboxflt to your kernel modules. To do so you will create a new file in <tt>/etc/modprobe.d</tt> using the following commands:
<nowiki>sudo nano /etc/modprobe.d/virtualbox</nowiki>
+
  
Then use <code>ctrl+shift+v</code> to paste the following lines into the file:
+
<nowiki>sudo nano /etc/modprobe.d/virtualbox</nowiki>
<nowiki>vboxdrv
+
 
 +
Then use <code>ctrl + shift + v</code> to paste the following lines into the file:
 +
<nowiki>vboxdrv
 
vboxnetadp
 
vboxnetadp
 
vboxflt</nowiki>
 
vboxflt</nowiki>
  
Once done press <code>ctrl+x</code> then <code>y</code> to save the file.  Once this step is complete, reboot your system.
+
Once done, press <code>ctrl + x</code> then <code>y</code> to save the file.  Once this step is complete, reboot your host system.
 +
 
 +
Once the host system has rebooted, start VirtualBox, but do start the VM.
 +
 
 +
Instead, in VirtualBox navigate to <code>File > Preferences > Network > Host Only</code> and hit the ''add'' button.  This should add a network named <code>vboxnet0</code>.
 +
To confirm, execute <code>ifconfig</code> in a terminal and check that <code>vboxnet0</code> is listed in the output of the command.
  
When you have rebooted you can start VirtualBox, but do not yet start your VM.  Navigate to <code>File > Preferences > Network > Host Only</code> and hit the add button.  This should add a network named <code>vboxnet0</code>.  To check if this worked, open a terminal and check that <code>vboxnet0</code> is in the output of the command <code>ifconfig</code>.  Now in VirtualBox highlight the VM and go to <code>Settings > Network > Adapter 2 > Host-Only vboxnet0</code>.
+
Back in VirtualBox, highlight the VM and go to <code>Settings > Network > Adapter 2 > Host-Only vboxnet0</code>.
  
 
Now you can start your VM and proceed to the '''Inside the VM''' section.
 
Now you can start your VM and proceed to the '''Inside the VM''' section.

Revision as of 15:13, 28 November 2016

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 running 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 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 host system.

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

Instead, in VirtualBox navigate to File > Preferences > Network > Host Only and hit the add button. This 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.

Back 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.

Back to the top