When you are reading this page, you should have downloaded the MPI or Spark virtual machine image. If not, please visit MPI VirtualBox Guide or Spark VirtualBox Guide first.
In this tutorial, we assume you already have VirtualBox installed. On Ubuntu, to install it you simply need to run
$ sudo apt-get update $ sudo apt-get install virtualbox
Let's start it step-by-step. :)First, import the image,
$ VBoxManage import pineapple.ovaboot the virtual machine,
$ VBoxManage startvm pineapple0 --type headlesswait for a few seconds and log in the virtual machine to check everything works well,
$ ssh -p 51000 spongebob@localhost (password: verysecure)and then power it off.
spongebob@pineapple0:~$ sudo poweroffOptional: If port 51000 has unfortunately already been used by another process, then please use another port, say, 52000.
$ VBoxManage modifyvm pineapple0 --natpf1 delete unnamed $ VBoxManage modifyvm pineapple0 --natpf1 "unnamed,tcp,,52000,,22"Because we are going to run Distributed LIBLINEAR, we need at least two machines. We can clone the existing one.
$ VBoxManage clonevm pineapple0 --name pineapple1 --register 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Machine has been successfully cloned as "pineapple1"Use port 51001 to ssh into your new virtual mahcine:
$ VBoxManage modifyvm pineapple1 --natpf1 delete unnamed $ VBoxManage modifyvm pineapple1 --natpf1 "unnamed,tcp,,51001,,22"It's time to boot your new machine:
$ VBoxManage startvm pineapple1 --type headlessNow try to ssh into your new machine:
$ ssh -p 51001 spongebob@localhost (Sure, your password is still "verysecure".)You may notice that your new machine now is still called "pineapple0," and its ip is still 192.168.0.1. We have to change them. First rename "pineapple0" to "pineapple1" in the following file.
spongebob@pineapple0:~$ sudo vi /etc/hostnameThen, add "192.168.0.2 pineapple1" to the following file.
spongebob@pineapple0:~$ sudo vi /etc/hostsChange 192.168.0.1 to 192.168.0.2 in the following file.
spongebob@pineapple0:~$ sudo vi /etc/network/interfacesIf you see the following message, no worries!
sudo: unable to resolve host pineapple0Reboot.
spongebob@pineapple0:~$ sudo rebootNow boot pineapple0,
$ VBoxManage startvm pineapple0 --type headlessadd "192.168.0.2 pineapple1" to the following file,
$ ssh -p 51000 spongebob@localhost $ sudo vi /etc/hostsand try to log in pineapple1.
spongebob@pineapple0:~$ ssh pineapple1 echo "hello" (Enter yes if you are questioned.) [some outputs skipped] helloIMPORTANT: You should see "hello" WITHOUT typing password.
Congratulations! You just planted two pineapples. Now go back to MPI VirtualBox Guide or Spark VirtualBox Guide to run Distributed LIBLINEAR.