Is it possible to run currently installed Ubuntu from Windows?
You can use coLinux and run your Ubuntu kernel with colinux:
I installed Ubuntu as normal on a separate partition and configured the computer to dualboot between Ubuntu/XP.
I installed coLinux with the Debian with backports image that is available on the coLinux website.
-
Configured coLinux so it could mount the Ubuntu partition, the trick here is to figure out the correct partition number. The partition number in coLinux seems to be lower that the partition number used when booting the computer with Ubuntu. In my case I had to setup:
<block_device index="1" path="\Device\Harddisk0\Partition5" enabled="true" alias="hda7"/>
Boot coLinux with the Debian with backports image and after boot mount the ubuntu partition in my case
/dev/hda7
-
To make it possible to boot ubuntu inside coLinux you need to turn of some services autostarted at boot, most of them har hardware related in some way and is not supported inside coLinux. You still want to run these services when not running ubuntu inside colinux. I did this by first creating a /etc/inid.d/colinux script according to http://wiki.colinux.org/cgi-bin/DualBootSystem
This script should of course be created in the/etc/init.d
directory on the ubuntu partition and not on the "debian with backports" image.
When this script has been created you also need to edit thedefault.colinux.xml
file so it contains aCOLINUX=1
boot-parameter, in my case:<bootparams>root=/dev/hda8 COLINUX=1</bootparams>
This script now makes it possible to turn of some autostarted services when starting inside coLinux but still run these services when dualbooting the computer with ubuntu. You also has to make sure to run this script at boot time by inserting links in the
/etc/rcS.d
directory. -
The next step is to turn of services by inserting if-statements inside the service scripts in
/etc/init.d
(on the ubuntu partition).if [ -f /var/local/colinux ] ; then exit 0 fi
I had to turn off the following services when booting inside coLinux to make it boot, coLinux crashed during boot when any of these services were running:/etc/init.d/gdm /etc/init.d/powernowd /etc/init.d/hotkey-setup /etc/init.d/pcmcia /etc/init.d/vbesave
Create colinux customized versons of some other files, the colinux script in init.d mentioned above makes it possible to have a colinux-version and a non-colinux version of some different files. In my case I have special versions of the following files:
/etc/fstab
(coLinux mounts the ntfs partitions using smbfs instead of ntfs read-only mounting)/etc/network/interfaces
(I didn't get colinux to work using DHCP so it has hardcoded IP numbers instead)/etc/gdm/gdm.conf
(I am not really sure this is used since gdm can't be started at boot, but I have a special version for coLinux with all [servers] disabled. It may be used when using vnc but I am not sure if it is needed)
It is important to remember to edit correct file when setting up these files this way because the normal files will be overwritten with *-colinux or *-non-colinux versions at each boot. It might be possible to setup symbolic links instead of overwriting the files but I have not tested this.Finally you will have to setup coLinux so it boots using the Ubuntu partition instead of the "debian with backports" image, this is done by setting a boot partition in the default.colinux.xml file, in my case it pointed to
/dev/hda8
<bootparams>root=/dev/hda8 COLINUX=1< /bootparams>
- It should now be possible to either start Ubuntu by selecting it in the dualboot(grub) menu when booting the computer or by starting XP and startup coLinux. Observe that when running inside coLinux the Ubuntu kernel is actually not used instead the coLinux kernel is used. This is important to think about for example if you need to recompiling kernels and kernel modules.
Finally, don't do the same mistake as I did. As described in this thread, I put XP/coLinux into sleep in hibernate mode and then dualbooted into Ubuntu. My Ubuntu file system got corrupt at next boot of XP and I decided to do a total reinstallation of Ubuntu.
If Ubuntu is on a separate partition you can create a *.vmdk file that virtualizes a physical partition and you should then be able to boot from this vmdk file inside virtualbox.
I think the command you look for to create a vmdk file is like this:
VBoxManage internalcommands createrawvmdk -filename <Absolute Path to output File> -rawdisk /dev/sda -register
I have never done this myself though so I can't really help you any further
andLinux is a complete Ubuntu Linux system running seamlessly in Windows 2000 based systems (2000, XP, 2003, Vista, 7; 32-bit versions only). This project was started for Dynamism for the GP2X community, but its userbase far exceeds its original design. andLinux is free and will remain so, but donations are greatly needed.
andLinux uses coLinux as its core which is confusing for many people. coLinux is a port of the Linux kernel to Windows. Although this technology is a bit like running Linux in a virtual machine, coLinux differs itself by being more of a merger of Windows and the Linux kernel and not an emulated PC, making it more efficient. Xming is used as X server and PulseAudio as sound server.
http://www.andlinux.org/