UPDATE: This tutorial is about ROS Fuerte (released on April 2012). The content still applies to the virtual machine for ROS Groovy Galapagos (Groovy was released on December 2012).
If you want to use the Robot Operating System (ROS), the first step is to install it on some PC. Ideally, it should be an Ubuntu box. In a previous post, we explained the installation procedure step by step in an attempt to make easy this tedious task. In this post, we provide you with an even simpler solution! Yes, we made all the setup for you, in a VirtualBox virtual machine that you can Download (~2.4GB), duplicate and use freely for your experiments. Please note that we provide this file with no warranty. We will though try our best to answer questions and fix reported issues.
We assume that you have VirtualBox installed on your laptop as well as the VirtualBox Extension Pack. The archive we provide is actually an OVA (Open Virtualization Archive) which is an open standard format for packaging virtual machines. We will show step by step how to use it with Mac OS X as a host operating system. The setup should be similar with other operating systems if you use the same version of VirtualBox as we do, which is 4.1.20.
Step 1: Launch the import process by selecting the “Import Appliance…” menu (see Picture 1). Note that this requires an extra 6.3 GB approximatively on you disk.
Step 2: Adjust the settings of the new virtual machine (see Picture 2). The default name is ROS. Since we want to be able to run our tutorial on networking with ROS, we will rename this virtual machine to C3PO. You may want to also adjust other properties such as the amount of memory allocated to the virtual machine or the number of CPU cores it will be using.
Step 3: You need to agree with the licenses (see Picture 3). Those are free sotware licenses of Ubuntu and ROS. Once you have pressed the Agree button, it takes a few minutes to get the virtual machine ready.
Step 4: Launch the virtual machine by pressing the Start button of the VirtualBox Manager as shown by Picture 4. The virtual machine automatically opens the default user account which login and password are both viki (a reference to the V.I.K.I character from the I, Robot movie).
Picture 4: Start the C3PO virtual machine
Step 5: Rename the host name from ROS to c3po by editing the /etc/hostname file. To do so, evaluate the following command line in a terminal.
sudo gedit /etc/hostname
You’ll get prompted to povide the password for the viki account which is also viki. Then, an editor will open. Change the content of the file to c3po before saving (see Picture 5).
Step 6: Map the IP address to the c3po host name by editing the /etc/hosts file. This can be done by evaluating the following command line in a terminal.
sudo gedit /etc/hosts
It will open an editor on the /etc/hosts file. Replace ROS by c3po and save the file (see Picture 6). So far, we just set the loopback address (127.0.0.1) to map to c3po. You can map it to other IP addresses as explained in our ROS networking tutorial.
Picture 6: Edit the /etc/hosts file
Step 7: Reboot Ubuntu, et voilà! You are ready to use ROS or run some ROS tutorial.
Regarding networking, there is a caveat. We set the virtual machine with a network bridged adapter connected to the Ethernet interface. If your hosting machine is connected to the network through internet via Ethernet, that’s fine. If you are using Wifi, you need to change the network setting (after having switched-off the virtual machine). However, on Mac OS X, the bridged adapter does not work with Airport for VirtualBox 4.1.2. Different solutions are possible:
There is an nice post about virtual machine network setup with VirtualBox. It provides clear explanations and drawings. We recommand you to read it if you wish to learn more about VirtualBox network options.