Preparing VirtualBox images

From Genecats
Jump to navigationJump to search

This is part of the Genome_Browser_in_a_Box_config

This is only relevant if ever someone wants to rebuild the GBIB image. These instructions are pretty old now and hopefully never needed. They are not useful for QA and there may be essential parts missing. In most cases, you are not interested in this page. Start with a fresh Ubuntu 14.04 image, call the main user "browser".

 apt-get install localepurge zerofree
 # I think we don't need these packages... saves around 300MB 
 apt-get install alpine acpi-tools gpm 
 apt-get install libgomp1 # for rnaplot
 # which package contains the psxy tool?
 
 apt-get remove python3* linux-headers* aptitude man-db perl perl-modules geoip-database language-pack-gnome-en-base manpages ppp acpi iso-codes console-setup dmidecode eject ethtool initramfs-tools pciutils usbutils command-not-found alpine-doc python3.3-minimal apparmor linux-firmware
 # wanna remove more? show packages by size: dpkg-query --show --showformat='${Package;-50}\t${Installed-Size}\n' | sort -k 2 -n
 apt-get install apache2 mysql-server mysql-client
 # consolkit keeps / open which is annoying for zerofill, acpi-tools doesn't really need I hope
 sudo dpkg -r --force-depends consolekit

Now install the genome browser:

 wget http://hgwdev.gi.ucsc.edu/~max/gbInstall/installBrowser.sh
 sudo bash
 source installBrowser.sh

This was in 2013. To redo this today, you can probably use the GBIC install script these days.

Install the Vbox guest extensions from the public ubuntu repos. Not sure about the commands. In 2013, I compiled from the ISO, but then later changed this to the proper debian packages.

On the guest again - it's nice to have shared folders:

 sudo addgroup vboxsf
 sudo adduser browser vboxsf

Copy the various files from kent/src/browserbox to their respective locations. This is explained in kent/src/browserbox/README.txt. Some more details are in kent/src/browserbox/root/changes.txt

Ask Hiram to install the trash cleaner.

Once you're finished with everything ubuntu related, you can free 120 MB (note: don't do this anymore, especially do not remove the man pages, unlike what I did in 2013):

 sudo wget http://hgwdev.gi.ucsc.edu/~max/browserbox/cleanVm
 chmod a+x cleanVm
 sudo cleanVm

Zero the disk image:

 sudo /root/zeroVm # this unfortunately does not work. You need to reboot in single-user mode and run it as root there

Leave VirtualBox, shutdown the VM, go to a command line on the host, find the .VDI or VMDK file(s) and compact it:

 vboxmanage modifyhd –compact browserboxBoot.vdi
 vboxmanage modifyhd –compact browserboxData.vdi

Have a quick look into the .vbox file and make sure that it doesn't list any iso images or other disk images that you attached once to the disk but don't need anymore. They trigger error messages on new host machines.

If you see a disk that is still attached (e.g the guest install iso), get its UUID first:

 VBoxManage list hdds
 VBoxManage list dvd

The remove it:

 VBoxManage closemedium disk <paste uuid here>

or

 VBoxManage closemedium dvd <paste uuid here>

the box release business is now automated with a script, in the qa user:

 boxRelease.sh

very obscure settings in gbib

https://www.virtualbox.org/ticket/12441

On the host:

 vboxmanage modifyvm browserbox --natdnsproxy1 on
 vboxmanage modifyvm browserbox --natdnshostresolver1 on

This makes sure that the VM network works after you sleep your laptop on OSX or you change the wifi connection.

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1009465

in /etc/rc.local

 echo 180 > /sys/block/sda/device/timeout
 echo 180 > /sys/block/sdb/device/timeout

This tells the linux kernel to accept longer delays when writing to disk. If your host OS is busy during an rsync job, it will fail without these settings.


 a2dismod deflate

This means that hgMirror can show its status message right away, it deactivates some buffering in apache on stdout.