-
Notifications
You must be signed in to change notification settings - Fork 5
butterfly VM
-
Download virtualbox
-
Download the Ubuntu 16.04 iso
# configure VirtualBox w/ Ubuntu (preferred 64-bit), 1 GB RAM (is enough!), no sound, 2 cores
### 1) install ubuntu
### 2) guest additions
# download .iso + mount on host as cd
$ sudo apt-get install -y dkms build-essential linux-headers-generic linux-headers-$(uname -r)
$ mount /dev/cdrom /media/cdrom
$ sudo sh ./VBoxLinuxAdditions.run
# verify installation
$ lsmod | grep vboxguest
### 3) mount shared folder
# add shared folder bfly_data pointing to path on host
$ cd
$ mkdir bfly_data
$ sudo mount -t vboxsf bfly_data /home/butterfly/bfly_data
### 4) setup butterfly
$ sudo apt-get install virtualenv
$ sudo apt-get install python-pip
$ cd
$ mkdir repo
$ cd repo
$ git clone https://github.com/Rhoana/butterfly.git
$ cd
$ mkdir env
$ cd env
$ virtualenv butterfly
$ source ~/env/butterfly/bin/activate
$ cd
$ cd repo/butterfly
$ git checkout update_v2
$ pip install -U pip
$ pip install -r requirements.txt
$ pip install -e .
### 5) every time when new data is added
$ bfly -e /home/butterfly/bfly_data -o /home/butterfly/.rh-config.yaml
Mount the shared folder
cd
mkdir bfly_data
sudo mount -t vboxsf bfly_data /home/butterfly/bfly_data
- Install a packaged virtualbox on your Linux, MacOS, or Windows server.
- This will give you the
VBoxManage
command, which you will use to set up the bfly VM. - Consult the
VBoxManage
Manual for anything not given here.
bflyvm=butterfly;
vdifile=$bflyvm/$bflyvm.vdi;
isofile=ubuntu-16.04.2-server-amd64.iso;
ostype=Ubuntu_64;
megadisk=10000;
megaram=1024;
ncores=1;
Even if your host server has a 64-bit processor, there are many reasons why you may not be able to host a 64-bit vm without further configuration. If your BIOS or motherboard simply won't support 64-bit, set ostype=Ubuntu;
and isofile=ubuntu-16.04.2-server-i386.iso
. You may also not set a higher ncores
if v-tx is not available.
VBoxManage createvm --name $bflyvm --register;
VBoxManage modifyvm $bflyvm --acpi on --boot1 dvd;
VBoxManage modifyvm $bflyvm --memory $megaram --cpus $ncores;
VBoxManage modifyvm $bflyvm --ostype $ostype;
VBoxManage modifyvm $bflyvm --cableconnected1 on;
VBoxManage modifyvm $bflyvm --nic1 nat;
If you don't need ssh, continue to set up the virtual machine.
Create a host-only network if none in VBoxManage list hostonlyifs
if [[ -z $(VBoxManage list hostonlyifs) ]]; then\
VBoxManage hostonlyif create;\
fi;
Get the host-only network and its ip.
vboxnet=$(VBoxManage list hostonlyifs | egrep -o 'vboxnet.' | tail -1);
vboxip=$(VBoxManage list hostonlyifs | egrep -o '192\.168\.[^.]*' | tail -1);
Continue by enabling DHCP for your host-only network:
VBoxManage dhcpserver add --enable --ifname $vboxnet --ip $vboxip.99 --netmask 255.255.255.0 --lowerip $vboxip.101 --upperip $vboxip.254;
- Set up host-only adapter
VBoxManage modifyvm $bflyvm --nic2 hostonly;
VBoxManage modifyvm $bflyvm --hostonlyadapter2 $vboxnet;
VBoxManage modifyvm $bflyvm --cableconnected2 on;
- cd to the VirtualBox VMs directory and get the iso file
cd $HOME/VirtualBox\ VMs;
wget http://mirrors.lug.mtu.edu/ubuntu-releases/16.04.2/$isofile;
- Set up port forwarding to access bfly on port 2018
VBoxManage modifyvm $bflyvm --natpf1 "bfly,tcp,,2018,,2018"
- Set up the hard drive and disk drive
VBoxManage createhd --filename $vdifile --size $megadisk;
VBoxManage storagectl $bflyvm --name "IDE Controller" --add ide;
VBoxManage storageattach $bflyvm --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium $vdifile;
VBoxManage storageattach $bflyvm --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium $isofile;
If you don't need a remote server, instead run the installation locally.
Install the RDP extension pack:
extpack=Oracle_VM_VirtualBox_Extension_Pack-5.1.18-114002.vbox-extpack;
wget http://download.virtualbox.org/virtualbox/5.1.18/$extpack;
sudo VBoxManage extpack install $extpack;
Start the Remote Desktop Protocol Server
port=2001
VBoxManage modifyvm $bflyvm --vrdeauthtype external;
VBoxManage modifyvm $bflyvm --vrdeport $port;
VBoxHeadless --startvm $bflyvm --vrde on &
The server will continue to run in the background until shutdown.
If you're having authentication problems on localhost, set VBoxManage modifyvm $bflyvm --vrdeauthtype null;
to remove all authentication.
After you see the above on the server, switch to a client with a Graphical User Interface.
Download and install a packaged xfreerdp on your Linux, MacOS, or Windows Client. This will give you the xfreerdp
command, which you'll use once to install Ubuntu.
xfreerdp /v:{host}:{port} /u:{uremote} /p:{upassword};
The above syntax works for xfreerdp>=1.2.0
. Older versions need xfreerdp {host}:{port} -u {uremote} -p {upassword};
Regardless, {port} is the same as the server, {host} is a registered name or IP address of the server, and {uremote} and {upassword} are any username and password on the host server.
VBoxManage startvm $bflyvm;
- Select Language
- Install Ubuntu Server
- Language, Location, keyboard, waiting
- if ssh: Choose enp0s3 network interface for installation
- Hostname:
butterfly
- Username:
butterfly
- Password:
butterfly
- Encrypt: No
- Timezone: Eastern
- Partition Disks
- Guided - use entire disk
- SCSI1 (0,0,0) (sda)
- yes, write changes
- HTTP Proxy Information
- Leave blank, continue
- No automatic updates
- Software Selection
- if ssh: OpenSSH Server
- standard system utilities
- Grub Boot Loader: yes
Now, return to a shell on the server where the vm is hosted.
- Shut down the server and eject the iso disk image
VBoxManage controlvm $bflyvm poweroff;
VBoxManage modifyvm $bflyvm --dvd none;
If you don't want a remote mount, you're ready to install butterfly
guestadd=/usr/share/virtualbox/VBoxGuestAdditions.iso
VBoxManage storageattach $bflyvm --storagectl "IDE Controller" \
--port 1 --device 0 --type hdd --medium $guestadd
VBoxHeadless --startvm $bflyvm &
On the remote client, again connect with:
xfreerdp /v:{host}:{port} /u:{uremote} /p:{upassword};
VBoxManage startvm $bflyvm;
Connect in the VirtualBox window that opens.
On the virtual machine, mount the guest additions drive.
sudo mkdir /mnt/dvd
sudo mount /dev/dvd /mnt/dvd
cd /mnt/dvd
sudo ./VBoxLinuxAdditions.run
On the host, poweroff
the virtual machine and add a shared path.
hostpath=/path/to/folder/
VBoxManage sharedfolder add $bflyvm --name bfly_data --hostpath $hostpath --automount
Start the virtual machine and mount the folder from within it.
cd
mkdir bfly_data
sudo mount -t vboxsf bfly_data bfly_data
If not ssh, continue to install butterfly
sudo printf '\n\n%s\n%s' 'auto enp0s8' 'iface enp0s8 inet dhcp' >> /etc/network/interfaces
sudo ifup enp0s8
- Then on the host server, connect to the vm:
ssh butterfly@$vboxip.101
Get the basic python packages
sudo apt-get install virtualenv
sudo apt-get install python-pip
Clone this repo
cd
mkdir repo
git clone https://github.com/Rhoana/butterfly.git repo/butterfly
Make the python environment
mkdir env
virtualenv env/butterfly
source ~/env/butterfly/bin/activate
Install butterfly
cd repo/butterfly
git checkout update_v2
pip install -U pip
pip install -r requirements.txt
pip install -e .
serve on port 2018
bfly 2018
Later, you can always reset the vm VBoxManage controlvm $bflyvm reset
Later, you can always power off the vm VBoxManage controlvm $bflyvm poweroff
If you need to start over, delete the vm VBoxManage unregistervm $bflyvm --delete
VBoxHeadless --startvm $bflyvm &
VBoxManage startvm $bflyvm;
-
Home
- API
- OCP
- Data Formats
- Developers
- Harvard RC Cluster
- Keywords
- Testing
- VM
- AccessLayer
- API
- OCP
- QueryLayer
- ImageLayer
- HDF5
- New Formats
- DatabaseLayer
- Mongo
- CoreLayer
- Core
- CacheSource
- CacheTile