Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am using Ubuntu 12.04.3 Live USB

I have created a 25GB .disk file that is located on the Windows partition. (Same as WUBI)

I have done: sudo losetup /dev/loop1 /mnt/<disk file location>/root.disk.

I can now see that .disk file using disk utility and it has a ext4 filesystem.

How can I add this disk (and a swap .disk file) to the Ubuntu Installer so I can install Ubuntu into the .disk files.

share|improve this question
    
You don't. You need to follow the normal install procedure to create a partition for Ubuntu. –  psusi Dec 6 '13 at 14:38
    
Like I said, you don't; the installer does not support that ( at least, it won't be able to install grub ). WUBI does it with a dirty hack and a dos build of grub legacy. –  psusi Dec 6 '13 at 15:59

1 Answer 1

Wubi uses two distinct techniques. The disk image technique downloads a preinstalled disk image file that has been compressed. Then it uncompresses this as the root.disk and then uses resize2fs to make it whatever size you want. Then it remains to create the user account at login which it does with a preseed file:

d-i clock-setup/utc boolean false
d-i time/zone string $(timezone)
d-i passwd/user-fullname string $(user_full_name)
d-i passwd/username string $(username)
d-i passwd/user-password-crypted password $(password)
d-i user-setup/encrypt-home boolean false
d-i netcfg/get_hostname string ubuntu
d-i debian-installer/locale string $(locale)
d-i keyboard-configuration/layoutcode string $(keyboard_layout)
d-i keyboard-configuration/variantcode string $(keyboard_variant)

All the $(xxx) are replaced by the Wubi installer - most are fairly straightforward, but my attempts to get the password correct failed (easily reset later).

Then it remains to boot the install with the preseed file:

loopback loop0 /ubuntu/disks/root.disk
set root=(loop0)
search --set=diskroot -f -n /ubuntu/disks/root.disk
probe --set=diskuuid -u $diskroot
linux /vmlinuz root=UUID=$diskuuid loop=/ubuntu/disks/root.disk preseed/file=/ubuntu/install/preseed.cfg wubi-diskimage ro quiet splash
initrd /initrd.img

Anyway that's the easiest way to get Wubi manually installed. I recently did it on a Virtual machine running EFI firmware.

The other technique is to get ubiquity (the desktop installer) to install directly to the root.disk. This requires a preseed file as well. Wubi kicks off the installer via grub4dos, then uses the kernel extracted from the ISO to boot the ISO (which has been saved to disk). Then it preseeds the installer. This is a lot more complex than using the pre-installed disk image.

share|improve this answer
    
I see, so if I'm right it would be easier for me to create a pre-installed image. I am trying to create a UEFI Secure Boot compatible image that I will boot via GRUB2 for EFI outside of the .disk image –  Dan Dec 7 '13 at 14:17
    
How difficult would it be to get ubiquity to install directly to the root.disk from a Live USB? Is it possible? –  Dan Dec 7 '13 at 14:26
    
@Dan It's definitely possible. If it's a manual kickoff from a live USB you'll have to provide the preseed file. There will probably be some mods to grub/lupin for generating secure kernels once you have it running (and also automatic installation of Grub to the /efi partition to boot it). Have you tried asking in #ubuntu-installer on Freenode? –  bcbc Dec 7 '13 at 18:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.