Saturday, February 21, 2015

Sage Math Live CD for VirtualBox

Sage Math consists of many mathematical and scientific tools and therefore the library dependencies can be quite hairy. Live CD makes it easier to do some quick and dirty job. However, booting into a live CD is quite inconvenient as far as data transportation goes, so I was trying to use VirtualBox to run a server and connect to it from the host computer.

There's a slight problem though. The Live CD image listed on the official download page is actually a raw image to write into a USB thumb drive. VirtualBox does not support mounting a image as a USB drive. Therefore, we need to convert the bootable USB thumb drive image to another format. I converted it to a hard drive image for more flexibility.

Here's how (I found it in this guide):

$ VBoxManage convertfromraw -format VDI 2014-11-16-sage_6.4-debian_wheezy-live_3.0.5-1.img 2014-11-16-sage_6.4-debian_wheezy-live_3.0.5-1.vdi

By the way, 2014-11-16-sage_6.4-debian_wheezy-live_3.0.5-1.img is a 64-bit Debian image, which needs to be configured properly in VirtualBox.