# Dual-boot with *Ubuntu, no partitioning needed, using Lubi

## tuxcantfly

I originally posted this howto guide at http://ubuntuforums.org/showthread.php?t=441918 but I posted it so that Gentoo users interested in trying out, dual-booting, or multi-booting with Ubuntu would be able to do so in an easy, risk-free way that requires no partitioning nor manual tweaking of bootloaders and config files.

Ever wanted to test the new K/X/Ubuntu 7.04 Feisty, but don't have a spare partition, and don't want to jeopardize your production environment by resizing partitions, dist-updating, or tinkering with its bootloader? Now you can leave your existing Linux distro (Ubuntu, Debian, Sabayon, Fedora, openSUSE, Gentoo, etc.) untouched, while being able to use Ubuntu 7.04 Feisty in a full-fledged install on a loopmounted partition, no partitioning required! Note: this guide is for Linux users, NOT for Windows users; Windows users should use Wubi http://cutlersoftware.com/ubuntusetup/wubi/en-US/index.html

Credits

I wrote Lubi and this guide. Lupin http://launchpad.net/lupin is used as the codebase, see the Wubi forum at http://ubuntuforums.org/forumdisplay.php?f=234 and the site at http://cutlersoftware.com/ubuntusetup/wubi/en-US/index.html for details.

Tested Versions

This has been tested on Sabayon 3.3 32-bit, PCLinuxOS 2007 32-bit, openSUSE 10.2 32-bit, Gentoo 2007.0 32-bit, Fedora Core 6 32-bit, Debian Sid 32-bit, Ubuntu 6.10 Edgy 32-bit, Ubuntu 7.04 Feisty 32-bit, and Xubuntu 7.04 Feisty 32-bit as the host systems. Kubuntu 7.04 Feisty 32-bit, Xubuntu 7.04 Feisty 32-bit, and Ubuntu 7.04 Feisty 32-bit were tested as guest systems. Other distros and versions, both 32-bit and 64-bit should work as the host system, just make sure you have the packages installed that are listed below. Distros and versions not based on Ubuntu 7.04 Feisty, and non-x86 architectures can also be used as the guest system, but these will require a custom build of lupin; see https://launchpad.net/lupin for details. Installations using LVM as the root filesystem are currently not supported. If this works/doesn't work for you please post the host/guest distro, version, and architecture.

What it does

Basically, it downloads a K/X/Ubuntu alternate i386 iso, creates loopmounted disk images so that they can be installed there, and adds an entry into /boot/grub/menu.lst which starts the d-i installer with that iso, and installs it into the loopmounted disk images. What thus results is a dual-boot system, in which K/X/Ubuntu are installed in loopmounted disk images in the folder /wubi/ on the filesystem, so that they can be installed without requiring any repartitioning, and they are booted using the system's GRUB, with the last menu entry, "Ubuntu", being added by the script to boot the loopmounted disk images.

Requirements/Dependencies

Before installing, please ensure that you have zenity (used for the GUI), and GRUB (used as the bootloader) installed. If not, install zenity and grub using emerge, apt-get, yum, yast2, or your distribution's equivalent. For Ubuntu and Debian, these should already have been installed.

Installing

1. Download the latest code from http://cutlersoftware.com/ubuntusetup/lubi

2. Then, become root:

For openSUSE and other su-based distros, login as root, while in Ubuntu and other sudo-based distros, enter:

```
sudo -s
```

3. Then, run the script:

```
chmod +x ./lubi.sh

./lubi.sh
```

4. Answer the questions asked by the wizard, wait while the iso is downloaded, the disk images are created, and the grub entry is added, and you will then be prompted to reboot; reboot.

5. Upon rebooting, the GRUB menu should have a new line at the end, saying "Ubuntu". Select that one, and it will start the d-i installer in non-interactive mode, and will reboot again

6. Select "Ubuntu" in GRUB to boot your newly installed ubuntu, then upon booting, login with the username and password you supplied to the installer

Uninstalling/Removal/Undoing Changes

These 2 commands, entered in the terminal, will remove your loopmounted Ubuntu install, and undo the changes to GRUB:

```

sudo rm -r /wubi

sudo mv /boot/grub/menu.lst.bak /boot/grub/menu.lst
```

Use this guide at your own risk, though if you encounter issues related to loopmounted installation, you should ask them in the Wubi forums at http://ubuntuforums.org/forumdisplay.php?f=234 as it is a generic Lupin/Wubi issue, not a Lubi problem. Post any issues related to Lubi here, and include the host and guest distro, architecture, and version. Also post results if installation succeeds on a host/guest distro/version/architecture combination that isn't listed above. The main lubi development page is at https://launchpad.net/lubi

----------

## LXj

I get Zenity errors when I try to use that. What version of Zenity could be used? (mine is 2.16.3)

Edit: Also that mess is a bit unreadable:

```
lx@LX ~/tmp/lubi $ sudo ~/bin/lubi -h all

Optional command line parameters and info: \n\nIf you have the iso (usage example): \n/home/lx/bin/lubi -u username -p password -r 4000 -m 4000 -s 1000 -i /path/to/file.iso -v hd0,1 -k pc105 -y us -a en_US \n\nIf you need to download the iso (usage example): \n/home/lx/bin/lubi -u username -p password -r 4000 -m 4000 -s 1000 -d ubuntu -v hd0,1 -k pc105 -y us -a en_US \n\nOther options and more info: \n-u username allows you to specify the user name \n-p password allows you to specify the password \n-r 4000 allows you to specify the root virtual disk size in MB \n-m 4000 allows you to specify the home virtual disk size in MB \n-s 1000 allows you to specify the swap virtual disk size in MB \n-i /path/to/file.iso allows you to specify which predownloaded iso to use \n-d ubuntu allows you to specify which distro to download and install \n-v hd0,1 allows you to specify the GRUB root device \n-k pc105 allows you to specify the keyboard model \n-y us allows you to specify the keyboard layout \n-a en_US allows you to specify the language

```

Edit2: Works with Zenity 2.18.2. I'll finish installation tomorrow (when iso is downloaded)

----------

## tuxcantfly

 *LXj wrote:*   

> Edit: Also that mess is a bit unreadable:
> 
> ```
> lx@LX ~/tmp/lubi $ sudo ~/bin/lubi -h all
> 
> ...

 

Ouch, that really isn't supposed to happen... All those "\n" characters are supposed to be displayed as newlines... What shell are you using? And what are your keyboard or font settings? Also, when you enter "echo \n" in your shell, what is displayed? I've only tested this on sh and dash, with an en-US pc104 keyboard and UTF-8 font settings, maybe the newlines aren't shown properly on some shells, I could really use some feedback to get this fixed...

----------

## LXj

I am using bash, which is actually the default shell in both Gentoo and Ubuntu  :Wink:  "echo \n" displays "n" in Ubuntu and "\n" in Gentoo I think (not sure about Gentoo atm)

Thanks for your script! I like the way how I've got a secondary Linux without messing with partitions and CDs. But the nicest thing is that it even imported some options from host OS.

However I see some minor differences from usual Ubuntu installation (some menus are not localized properly), maybe that is an issue of using alternate ISO.

You script creates new /home and swap partitions. Why not to use existing partitions for that? I re-configured it that way right after installing

----------

## tuxcantfly

 *Quote:*   

> I am using bash, which is actually the default shell in both Gentoo and Ubuntu  "echo \n" displays "n" in Ubuntu and "\n" in Gentoo I think (not sure about Gentoo atm) 

 

Whoops, I had done most testing in dash, seems like I missed that one... Anyhow it should now be fixed in the latest version on the SF download page...

 *Quote:*   

> some menus are not localized properly

 

Hmm seems like the locale settings didn't get detected properly... Mind posting the results of the command "locale" in the host Gentoo and the guest Ubuntu?

 *Quote:*   

> You script creates new /home and swap partitions. Why not to use existing partitions for that?

 

Reusing the swap sounds good (I'll have that included in Wubi and Lubi soon), but I'm not too sure about reusing /home; if say the username is the same, then there could potentially be a lot of conflicting user settings and the like...

----------

## LXj

 *tuxcantfly wrote:*   

> Hmm seems like the locale settings didn't get detected properly... Mind posting the results of the command "locale" in the host Gentoo and the guest Ubuntu?

 

I tried to install Ubuntu from alternate ISO, and found out that it asks to download additional localization packages while installing. So seems like the absence of these packages is the reason for bad localization in Lubi installation. Locale is detected properly, it's ru_UA.UTF-8 in both my systems

----------

## odegard

The question is, can this be done with gentoo?

----------

## tuxcantfly

 *Quote:*   

> The question is, can this be done with gentoo?

 

If what you mean is that Lubi can run on Gentoo, and install Ubuntu without needing to repartition the hard drive or download the CD, then yes

If what you mean is the same as above, only install Gentoo instead of Ubuntu, then that'll be a bit trickier if you want to do it with the loopmounting approach used by Wubi. However, you could always use the Gentoo netboot initrd and kernel using UNetbootin to achieve the no-CD installation of Gentoo from Windows or another Linux distro (see the lubi website at http://lubi.sourceforge.net/ for details), all you have to do is download my UNetbootin code at https://launchpad.net/unetbootin replace the Ubuntu kernel and netboot initrd with Gentoo's kernel and netboot initrd, rebuild it using the build script, and you'll be good to go

----------

## tuxcantfly

Also if any of you haven't yet noticed Lubi now has its own site at http://lubi.sourceforge.net/

----------

## hoyanf

Nice job.. will try it since less hassle on repartitioning...

Great job...

----------

## tuxcantfly

Also, if anybody is interested in an installer that can install Fedora, Ubuntu, or Debian from any linux distribution or Windows, without needing a CD, see UNetbootin http://lubi.sourceforge.net/unetbootin.html

----------

## tuxcantfly

 *odegard wrote:*   

> The question is, can this be done with gentoo?

 

Slight update, my new application, UNetbootin now supports Gentoo as a target distribution; therefore, it can now create Gentoo LiveUSB installations from Windows or Linux, as well as "frugal installs" via which Gentoo can be installed. The application and screenshots at http://unetbootin.sourceforge.net/ should be rather self-explanatory (it has a nice, user-friendly GUI); however I might write a seperate howto thread for Gentoo if it's needed.

----------

## padoor

i have already downloaded the alternate iso of ubuntu-studio-8.04.1

now the above program will again download ? or can i use the path for the downloaded file?

i will try it inside my current ubuntu-8.04 installation.

will be back after i get some result  :Smile: 

----------

## tuxcantfly

 *padoor wrote:*   

> i have already downloaded the alternate iso of ubuntu-studio-8.04.1
> 
> now the above program will again download ? or can i use the path for the downloaded file?
> 
> i will try it inside my current ubuntu-8.04 installation.
> ...

 

I'll tell you ahead of time, it won't work, nor will any other alternate isos for Ubuntu 8.04 (liveCD isos will work with UNetbootin). If you already have Ubuntu installed, simply install the package ubuntustudio-desktop and you'll be set to go.

----------

## padoor

i did run the Unetbootin from win2k and selected an empty partition and the iso downloaded.

it extracted all in the said partition.

but i cant boot from it .

it corrupted my grub and i had to run grub-install again from mounted pclinuxos.

the desktop is now working ok.

you mean to say my 8 hrs download of the big iso file is waste?

i have the extracted iso contents in an empty partition.

can i install from it any means or not?

if i make a dvd from the iso also it wont work? then i dont want to waste a dvd also.

how you were sure it will not work?

the menu on the screen made me hpeful it would work.  :Sad: 

but as you said it does not want to boot from the partition or usb stck

now have you any suggestions to use the downloaded file?

running install ubuntu studio is not what i want to do. again another 8 hrs download.

awaiting your reply  :Smile: 

----------

## tuxcantfly

 *padoor wrote:*   

> i did run the Unetbootin from win2k and selected an empty partition and the iso downloaded.
> 
> it extracted all in the said partition.
> 
> but i cant boot from it .
> ...

 

You can install using the hd-media installer at http://archive.ubuntu.com/ubuntu/dists/hardy/main/installer-i386/current/images/hd-media/ which can be loaded by UNetbootin; install boot.img.gz to a USB stick using UNetbootin and boot from it.

Alternatively, you can add your CD as a local apt-get mirror and install ubuntustudio-desktop from it

Or, you can simply install the .deb files one by one

FYI, most of that ISO file consisted of packages common to both ubuntustudio and ubuntu (kernel, libraries, base system, and GNOME). If you install ubuntustudio-desktop via apt-get, you'll only need another 100 MB or so of packages.

----------

## padoor

[root@localhost ~]# cd '/mnt/hda8/install'

[root@localhost install]# dir

initrd.gz  mt86plus  netboot  readme.sbm  sbm.bin  vmlinuz

[root@localhost install]#

these are contents of the install folder of the extracted iso.

can i not try to use the vmlinuz and initrd to boot from here

you did not tell me if i make a dvd od this iso it will work or not.  :Smile: 

i have a good mind to burn a dvd and see if it differs from this extraction  :Smile: 

----------

## tuxcantfly

 *padoor wrote:*   

> [root@localhost ~]# cd '/mnt/hda8/install'
> 
> [root@localhost install]# dir
> 
> initrd.gz  mt86plus  netboot  readme.sbm  sbm.bin  vmlinuz
> ...

 

Use the vmlinuz and initrd.gz found at http://archive.ubuntu.com/ubuntu/dists/hardy/main/installer-i386/current/images/hd-media/ to boot from it

The alternate iso file should be bootable if you burn it to a DVD, though I've never tried it

----------

## padoor

i have a dvd in the drive.

i will do the burn and and see if it will do any good.

thanks for your patient replies.  :Smile: 

wii get back if it boots from dvd say in half hr.  :Smile: 

----------

## padoor

burning the dvd worked ok

installed without incidents.

works nicely.

thanks for all supports.  :Smile: 

----------

