Last thing you'll ever read…again
Archive for April, 2009
Tutorial: Boot existing Ubuntu Partition using Virtualbox inside Windows (deprecated)
Apr 28th
Edit 22/11/09
Ubuntu 9.10 uses the new grub 2 as its boot-loader thus this article would not work for 9.10. I am currently in the progress of getting 9.10 to work under Virtualbox.
This tutorial would no longer be supported. Any comments regarding support will be ignored.
If you want to get 9.10 working please READ THIS ARTICLE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I recently got Windows 7 and Ubuntu running in a dualboot. However, since I’m using more of Windows now I figured I should probably find a way to run Ubuntu inside my Windows. VM’s are great, but it’d be better if I can actually boot into my existing Ubuntu partition. So I searched the web and kept on finding tutorials on how to boot existing XP partitions inside Windows. So I decided to extrapolate from those tutorials and work my way through it. I’ll be writing how I did it here.
Before we begin, you should have a dual boot setup. I will NOT be showing you how to setup a dual boot, if you need help plenty of other guides out there.
Step 1: Creating a grub boot iso
The grub iso file will allow you to specify which partition to boot into.
- Boot into Ubuntu
- We create the folders and copy the necessary files to setup an iso
Run the command: cd ; mkdir -p iso/boot/grub ; cp /usr/lib/grub/*-pc/stage2_eltorito /boot/grub/menu.lst iso/boot/grub - Configure your ~/iso/boot/grub menu.lst file to boot your target OS (in this case Ubuntu). Remove the “savedefault” option from your target entry if it exists.
- We now create the bootable iso file
Run the command: cd ; mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o grub.iso iso - Move the iso to a location that’ll be accessable by your Windows partition
Step 2: Creating the .vmdk file
This creates a file which tells Virtualbox what partition to actually load as the harddrive. Unfortunately, unlike VMWare Workstation, Virtualbox does not support a GUI interface for selecting RAW hard disks as the “virtual hard drive”.
- Boot into Windows
- cd into the directory you installed virtualbox
- We find the partition number that needs to be mounted
Run the command: VBoxManage.exe internalcommands listpartitions -rawdisk \\.\PhysicalDrive1
(where 1 is the number of the hard drive ubuntu is installed on. E.g. Master should be 0, you’re second hard-drive should be 1 etc…The output should be something like:Number Type StartCHS EndCHS Size (MiB) Start (Sect)
1 0×07 0 /32 /33 1023/254/63 902023 2048
5 0×83 1023/254/63 1023/254/63 49677 1847346543
6 0×82 1023/254/63 1023/254/63 2164 1949086188In this example, my Ubuntu partition is number 5 and the swap is number 6
- We now create the VMDK file with the given information
Run the command: VBoxManage.exe internalcommands createrawvmdk -filename C:\path\ubuntu.vmdk -rawdisk \\.\PhysicalDrive1 -partitions 5,6 -register
Step 3: Setup Virtualbox
Now everything should be ready to setup Virtualbox. Create a new virtual machine. Select the .vmdk file we just created as the hard drive and mount the grub.iso file we created at Step 1. If everything was successful Ubuntu should boot up nicely.
DONE!
If this has helped you in any way, please take the time to drop a comment! If you have any problems, just post a comment or send me an email through the “Contact me” page.
References:
Ubuntu 8.10 to Windows 7 Beta to Ubuntu 9.04 to Windows 7 RC
Apr 25th
Originally my hard-drive crashed. So I decided to install Windows 7 beta, just to give it a spin. I loved it. Never have I ever gotten used to an operating system so quickly before. Everything just worked.
I promised I would install Ubuntu 9.04 beta when it gets released but it just had too many known issues so I decided to wait until the full version gets released.
I installed Ubuntu today and now I’m running it. To be honest, I don’t enjoy it. The screen feels so much smaller. It’s amazing how the looks of an operating system can actually make your monitor feel small. Windows xp makes my monitor feel HUGE, Ubuntu on the otherhand makes it feel tiny. It also hurts my head a bit just staring at it. Everything is so jagged.
Coincidentally, Windows 7 rc also got leaked today.
So this is what I’m going to do.
Format my computer again. Install Windows 7 rc and then just VM ubuntu. I’ll stick in some more ram so the VM can get some decent amoutns of ram.
Hopefully I haven’t used up considerable amounts of bandwidth setting up Ubuntu.
But yes. Microsoft, you have won me back.
I’ll probably wait until later tonight before downloading/installing the RC. Don’t wanna use up any more bandwidth setting up my OS.
Memories
Apr 6th
So I came up with a great idea the other day. It’s rare that I come up with great ideas but I did. I have around 200mb of chatlogs, dating back to 2004. That’s 5 years worth of chatlogs. Half of it is purely txt whilst the other half is HTML.
So I was going through my gmail the other day and decided to go through my chats and a thought came to me. Google stores chatlogs as emails. Wouldn’t it be great if gmail can store all my other chatlogs as emails?
So I got to work. First thing I did was to see if it was already done already. Somebody it seems has already done it, except the script was written in VB, and it didn’t work…causing some kind of runtime error. I looked up ways to generate my own .msg files, import them into Outlook and then syncing outlook with gmail. msg files it seems is a messy piece of crap, mixing what appears to be binary with txt. So, I looked elsewhere. I discovered that Thunderbird stored emails in plain txt. Excellent. I just had to extract the formatting for the mail headers and write a script that parses all my chatlogs and outputs each individual converstion into neat little emails.
After an hour or so tinkering with a python script I was able to generate a thunderbird compatible email folder. But then came the problem of uploading it all. Gmail apparently restricts the amount of emails you can upload at any given time. 10 emails at a time is fine…50…it just dies. So now I have to find ANOTHER solution. Well, I found that google has developed a rather obscure app called “Google email uploader” it allows you to upload your emails from Outlook/Thunderbird to a Google App hosted email address.
Luckily, I have one so I can upload it to my domain email address. I’ll then have to sync it to my normal gmail account. Yes, it’s quite an endeavour just to store some chatlogs but hey, it’s fun!
I’ll also have to find a way to embed images into the emails, something that I have no idea where to start.
But yeah, I’ve been going over some extremely old chatlogs and it’s made me miss some of the things that I used to talk about.
Well, for those who are interested, I’ll post up a copy of the script later. There’s gonna be two versions, one for Messenger Plus! logs and the other for pidgin.