I want to use both Ubuntu Wubi 11.04 and Ubuntu Wubi 12.04 so that the boot menu will displays 3 options: Windows, Ubuntu 11.04 & Ubuntu 12.04. My current approach is to only use either of them, and disable the other. Is there anyway to do it?
-
Its about Wubi and you have evrything here http://wubi.sourceforge.net/faq.php – beeju May 01 '12 at 07:57
1 Answers
You can't do it via the Windows boot manager. You can only do it with the manual switching (as you are apparently doing) or via a custom grub entry.
Step by step:
- install first release (either 11.10 or 12.04)
- copy
\ubuntu
directory to\ubuntufirst
(or to be quicker, rename to\ubuntufirst
, and then create a new\ubuntu
directory withuninstall-ubuntu.exe
, which is required to uninstall the first release) - install the second release
boot Ubuntu and add a custom grub entry to boot the first release. You would edit
/etc/grub.d/40_custom
and then runsudo update-grub
. You can copy the entry from the/boot/grub/grub.cfg
on the install you want to boot. An example of the entry would be something like the following:menuentry 'Ubuntu, Other Wubi' --class ubuntu --class gnu-linux --class gnu --class os { set gfxpayload=$linux_gfx_mode insmod part_msdos insmod ntfs set root='(hd0,msdos3)' search --no-floppy --fs-uuid --set=root YOUR-UUID-HERE loopback loop1 /ubuntufirst/disks/root.disk set root=(loop1) linux /vmlinuz root=UUID=YOUR-UUID-HERE loop=/ubuntufirst/disks/root.disk ro quiet splash vt.handoff=7 initrd /initrd.img }
A couple things to note... you change loop0
to loop1
because loop0
will be in use already (with your original install). Also, use /vmlinuz
instead of /boot/vmlinuz-3.x.x-x-generic
because then you don't have to keep updating it (/vmlinuz
points to the latest). The same applies to /initrd.img
Here's my working example (in this case the copy is in the same \ubuntu\disks
folder):
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry 'Ubuntu - backup precisenew.disk' --class ubuntu --class gnu-linux --class gnu --class os {
set gfxpayload=$linux_gfx_mode
insmod part_msdos
insmod ntfs
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root 18B4B7BBB4B799A8
loopback loop1 /ubuntu/disks/precisenew.disk
set root=(loop1)
linux /vmlinuz root=UUID=18B4B7BBB4B799A8 loop=/ubuntu/disks/precisenew.disk ro quiet splash vt.handoff=7
initrd /initrd.img
}
This is what it looks like when booted
bcbc@arcturus:~$ mount | grep ' / '
/dev/loop0 on / type ext4 (rw,errors=remount-ro)
bcbc@arcturus:~$ sudo losetup /dev/loop0
/dev/loop0: [0803]:34470 (/host/ubuntu/disks/precisenew.disk)
bcbc@arcturus:~$
If you use this technique you probably should update /etc/fstab
to reflect the updated locations. It won't affect /
but if you have a separate /home
or you want to use the correct swap.disk
.
In my opinion, this isn't a useful solution for most people. Wubi is designed to be simple for beginners. But if you are using it to test different releases, there aren't many options for booting into them, other than renaming the \ubuntu
directory and updating C:\wubildr
each time.
NOTE: When Grub is updated on a Wubi install, it will rebuild the /wubildr
file and this will point to whatever the current virtual disk is. In the above example, it will point at precisenew.disk
. This is likely undesirable as it's simpler to have a master install. To avoid this happening you can either keep backups of your C:\wubildr
file, or edit /usr/share/lupin-support/grub-mkimage
on the secondary install (not your main one):
--- /mnt/usr/share/lupin-support/grub-mkimage 2011-09-20 03:44:44.000000000 -0700
+++ /usr/share/lupin-support/grub-mkimage 2012-10-29 22:02:55.784517389 -0700
@@ -112,7 +112,7 @@
exit 1
fi
fi
-
+exit 0 # for non-primary install, bypass creation of wubildr
wubildr_partitions="$(find_wubildr)"
if [ ! -f "$target" ] && [ -z "$wubildr_partitions" ]; then

- 6,026
-
-
@CuriousApprentice Yes, I have tried and it works. I now have Win 7 + Ubuntu 12.04 Desktop(32 bit) and Ubuntu 12.04 Server(64 bit). Note: In 12.04 Ubuntu Wubi install by default hides GRUB boot menu, so you will have to enable the GURB menu in /etc/default/grub. See here – Jahangir Feb 21 '13 at 19:21