WubiGuide

Differences between revisions 75 and 76
Revision 75 as of 2008-01-04 20:36:26
Size: 21047
Editor: adsl-69-234-228-230
Comment: updated recovery guide
Revision 76 as of 2008-01-04 20:42:10
Size: 21003
Editor: adsl-69-234-228-230
Comment:
Deletions are marked like this. Additions are marked like this.
Line 184: Line 184:
Boot the Ubuntu Desktop CD (preferably 7.04 or newer), or another LiveCD, and create mountpoints: Boot the Ubuntu Desktop CD (preferably 7.10, though 7.04 will also work), or another LiveCD, and create mountpoints:
Line 191: Line 191:
With the livecd's kernel-based ntfs driver, you'll only be able to get read-only access, so it is recommended to install the read-write ntfs-3g driver (you'll need a ubuntu 7.04 livecd to do this, though, the earlier versions don't have ntfs-3g in the repos): This step installs the read-write ntfs-3g driver. It is only necessary if you're using the 7.04 desktop CD. Ubuntu 7.10 comes pre-installed with ntfs-3g, so skip this if using the 7.10 desktop CD.

Introduction

What is Wubi?

Wubi is an unofficial Ubuntu installer for Windows users that will bring you into the Linux world with just a few clicks. Wubi allows you to install and uninstall Ubuntu as any other application. If you heard about Linux and Ubuntu, if you wanted to try them but you were afraid, Wubi is for you.

How to use this guide

This guide is intended for advanced users that want to tweak the standard installation. The standard installation has default settings that will work for most people. For general information on Wubi see the [http://wubi-installer.org Wubi official website]. You might also be interested in the [http://www.ubuntuforums.org/forumdisplay.php?f=234 Wubi Forum].

Please note that this guide is only for issues directly related to the Wubi installer; for general Ubuntu questions please use appropriate resources like [http://help.ubuntu.com/ the official Ubuntu documentation] or [http://www.ubuntuforums.org/forumdisplay.php?f=131 ubuntuforums] or [http://www.ubuntuguide.org ubuntuguide].

Wubi 7.10

Wubi 7.10 is getting there... You can find experimental alpha versions in http://wubi-installer.org/devel/minefield/ When we are satisfied with it, that will be made available via the main website.

  • It is recommended to uninstall previous Wubi versions before trying out Wubi 7.10.
  • Also run chkdsk /r from windows. Defragmenting also helps.
  • If you see an error about "the file system type ntfs cannot be mounted on /. because it is not a fully-functional Unix file system. Please choose a different file system.", then you need to run chkdsk /r from windows and boot into Ubuntu again
  • Note that 7.10 requires the DESKTOP ISO, you can download it manually and place it in the same folder containing the Wubi executable.
  • Report any issue on http://www.ubuntuforums.org/forumdisplay.php?f=234

Upgrading from 7.04 to 7.10

Upgrading from 7.04 to 7.10 is NOT supported at the moment, due to the fundamental differences between 7.04 and 7.10. An upgrade script will be provided later on. The best route is to uninstall and install Wubi-7.10 (you can save the old image files and access them from 7.10) or [http://lubi.sourceforge.net/lvpm.html move your 7.04 installation to a dedicated partition via LVPM], then [http://www.ubuntu.com/getubuntu/upgrading upgrade using the standard upgrade-manager tool].

Starting with Wubi 7.10 it will be possible to upgrade to a future version via standard tools.

Inclusion into official Ubuntu

Wubi 7.10 was supposed to be shipped with the LiveCD. Unfortunately we have been blocked by other projects (unionfs in particular) and testing has been very difficult until literally a couple of days before beta. That was too short time to solve the remaining issues and hence it was decided to only include a limited version of wubi in the LiveCD (wubi-cdboot) which will help people boot a physical CD going around bios issues (so instead of having to change the boot order in the bios, you can now use wubi-cdboot). We are still in for 8.04 as far as the Live CD goes.

Yet a lot of code has been ported and it is now embedded in the official release. Most of lupin (wubi backend) is now in Ubuntu 7.10, thanks to the efforts of 2 of the leading Ubuntu developers, Colin Watson and Evan Dandrea, as well as Agostino Russo. Lots of other improvements were also made to the front-end by Agostino Russo and to projects Wubi relies upon: namely grub4dos (Tinybit and Bean123) and MetaDl (Hampus Wessamn). Geza Kovacs has been focusing mostly on LVPM, Lubi and UNetbootin (hopefully LVPM will be merged with Ubiquity in the next release cycle).

Installation

How do I make Ubuntu the default boot option?

Ubuntu is not installed as the default boot option, you have to select it in the windows boot menu. To change that, in windows XP go to control_panel > system > advanced > startup_and_recovery and edit the "Default Operating System", if you want you can change the timeout as well.

How do I install on a machine with no internet connection?

Try to find a computer with internet access, and download both Wubi and the required ISO (containing the installation files):

Then copy both files within the same folder on the machine with no internet acces. Then run the Wubi executable. If you have internet access on the machine where you plan to install Ubuntu, you only need Wubi (the first link), Wubi will automatically download the other file as required.

How can I use a manually downloaded ISO?

You need to download the appropriate ISO of the appropriate version. Place the ISO in the same folder where you have Wubi-7.04-XYZ.exe. Then run Wubi.

Note: 7.04 requires the ALTERNATE ISO 7.10 requires the DESKTOP ISO

How do I install Kubuntu/Xubuntu/Fluxbuntu?

There are 2 ways of doing that. You can install your favorite distro from within Wubi (see the advanced settings), or you can install just Ubuntu and then once you are in Ubuntu, you can install the other desktop environments as normal packages. Each desktop environment is available as a single package (e.g. kubuntu-desktop). That will probably require a larger disk image (see below), but it's the preferred option, since you will not have to reboot to change the desktop, simply log-off and choose the desktop environment in the options at login. The first option is recommended only if you want a single desktop environment, e.g. if you have an old machine and want to use Xubuntu (Xfce) without having to install Ubuntu (Gnome).

Can I have multiple linux installations at the same time?

As explained above, there is probably no need, but the answer is yes.

  1. Do a normal installation,
  2. Rename C:\wubi\disks\system.virtual.disk into something else (say ubuntu.virtual.disk)
  3. Reinstall, say using kubuntu ISO
  4. Rename system.virtual.disk to kubuntu.virtual.disk. So you should now have C:\wubi\disks\ubuntu.virtual.disk and C:\wubi\disks\kubuntu.virtual.disk
  5. Edit C:\wubi\grub\menu.lst:
    • Comment out the hidemenu option (put a "#" in front of it, so that the menu is displayed)
    • Increase the timeout time (how long the menu is displayed before selecting the default option)
    • Copy the last block starting with "title". Each title block is a boot menu entry
    • Give an appropriate title to each of the 2 blocks (e.g. "title Ubuntu" and "title Kubuntu")
    • Add the kernel paramter "system_virtual_disk=ubuntu.virtual.disk" to the first block and "system_virtual_disk=kubuntu.virtual.disk" to the second one.

Note: you will see 2 boot menus: one to choose between Windows and Ubuntu, and one to choose between Ubuntu and Kubuntu. It is not possible at the moment to do that directly in boot.ini (grldr cannot take menu.lst as a boot.ini parameter)

What Operating Systems are supported?

Windows Vista, XP, and 2000 are known to be working fine with Wubi. Windows 98 should also work, but it has not been thoroughly tested. Windows ME is not supported. Linux is supported through Lubi http://lubi.sourceforge.net/.

How do I reinstall Wubi?

Run Wubi-7.04-XYZ.exe again. Wubi will detect that there is an existing installation and you will be shown an option to uninstall. You can back up your home files if you wish, and you probably want to backup the installation files (the ISO) in order to avoid to have to download them again. Remember that if your installation stops half way through for whatever reason, you need to reinstall otherwise you will get an (almost) useless prompt. Note that when you reinstall, the system virtual drive (system.virtual.disk) is reset, while the virtual drive containing personal files (home.virtual.disk) is left untouched.

Uninstallation

How do I uninstall Wubi?

Run the uninstaller in add-remove programs

How do I manually uninstall Wubi?

Remove C:\wubi and C:\wubildr*. Then edit C:\boot.ini and delete the Wubi line. C:\boot.ini is normally protected. To edit it, go to control_panel > system > advanced > startup_and_recovery and press Edit.

Virtual Disks

What are the different disk files for?

There are 5 special files under C:\wubi\disks\. Such files are seen by Linux as real Hard Disks. Let's meet them:

  • system.virtual.disk contains the system files and all the software, it is equivalent to C:\WINDOWS and C:\Program Files. It is mapped to /dev/loop7 and mounted as /.
  • home.virtual.disk contains personal files (shared or not) and user profiles. This is normally used to to store your office documents, music files, pictures... It is equivalent to "My Documents". It is mounted as /home.
  • swap.virtual.disk is used by the operating system to help out the memory. In order to safely hibernate/suspend, swap.virtual.disk should be as large as the RAM. There is often no need to make it any larger than that. It mounted as swap.
  • extra.virtual.disk is an optional virtual disk. If found, it is mounted /media/extra.
  • programs.virtual.disk is an optional virtual disk. If found, it gets mounted under /usr.

How big are the virtual disks?

The default size is calculated automatically based on your free space, you can change that in the advanced settings. The space is not actually fully used, a barebone installation take less than 2GB including all the preinstalled software (office suite, games, graphics applications, etc...), but if the virtual disks were of 2-3GB you would soon run out of space once you start installing extra software. Remember that on FAT filesystems the virtual disks cannot be larger than 4GB.

How do I create a virtual disk in Ubuntu?

Open a terminal (Applications -> Accessories -> Teminal), and enter these commands (this will create a 10 GB extra.virtual.disk, adjust line 2 to change these):

{{{cd /media/host/wubi/disks dd if=/dev/zero of=extra.virtual.disk bs=1000 count=0 seek=$[1000*1000*10] mkfs.ext3 -F extra.virtual.disk}}}

How do I create a virtual disk in Windows?

You can use qemu-img for that. Another dirty trick (but working) is to copy any other file of the desired size to c:\wubi\disks and rename it "system.virtual.disk", "home.virtual.disk", "swap.virtual.disk" or "extra.virtual.disk". That's the wubi equivalent of buying (and installing) a new hard disk Wink ;)

If you are running Windows XP (may work in Windows 2000 and Vista as well) you can create a file by using the fsutil that is included with Windows. The command format is fsutil file createnew filename filesize where filename is the file you wish to create and filesize is the size of the file to be created in bytes.

How do I resize system.virtual.disk?

Use LVPM, at http://lubi.sourceforge.net/lvpm.html

How do I resize the home.virtual.disk virtual disk?

Use LVPM, at http://lubi.sourceforge.net/lvpm.html

How do I access (r/w) the (NTFS) Windows drives?

Ntfs-3G is installed automatically by Wubi, and the windows drive hosting the wubi folder is automatically mounted under /media/host. To access other drives via ntfs-3g:

  1. Make sure you have internet access (see the network icon on the top right)
  2. Open the "Applications" menu and select "Add/Remove..."
  3. In the listbox on the right select: "Show All Available Applications"
  4. Search for "NTFS" and select "NTFS Configuration Tool". Click OK to install it
  5. Run the configuration tool under Applications > System Tools > NTFS Configuration Tool

  6. Select "Enable write support for internal device". Click OK to set it up.

How do I access the (NTFS) Windows drives the good old way?

You need to find out the device name of the windows drive by running "sudo fdisk -l", you can mount the drive manually or automatically. To do things the old way:

#look for the windows device
sudo fdisk -l
sudo mkdir /media/windows
#assuming the windows drive you want is /dev/hda1
ntfs-3g /dev/hda1 /media/windows
#windows files should now be under /media/windows

To mount it automatically run the following command replacing /dev/hda1 with the appropriate device:

sudo $(
    mkdir /media/windows
    echo "/dev/hda1 /media/windows ntfs-3g defaults 0 0" >> /etc/fstab
)

How do I get rid of the virtual disks and switch to real partitions, and/or get rid of Windows entirely?

The existing Wubi/Lubi install can be upgraded to a full, real ubuntu install with dedicated partitions using LVPM. The main site for LVPM is at http://lubi.sourceforge.net/ and the guide and support forum is at http://ubuntuforums.org/showthread.php?t=438591

How can I access my Wubi install and repair my install if it won't boot?

Boot the Ubuntu Desktop CD (preferably 7.10, though 7.04 will also work), or another LiveCD, and create mountpoints:

sudo mkdir /media/windows
sudo mkdir /media/wubi

This step installs the read-write ntfs-3g driver. It is only necessary if you're using the 7.04 desktop CD. Ubuntu 7.10 comes pre-installed with ntfs-3g, so skip this if using the 7.10 desktop CD.

sudo apt-get update
sudo apt-get install ntfs-3g

Then, assuming that your Windows drive is /dev/sda1 (adjust line accordingly, you can use sudo fdisk -l to find it out; see whichever one says HPFS/NTFS on the type line), mount the partition using ntfs-3g:

sudo ntfs-3g /dev/sda1 /media/windows

Otherwise, to automate this process to mount the first Windows (NTFS) partition found on the hard drive, enter:

sudo ntfs-3g $(sudo fdisk -l | grep NTFS | head -1 | sed 's/\t/\n/g' | sed 's/ /\n/g' | grep /dev) /media/windows

Before mounting the virtual disks, you'll want to check to see if the filesystems aren't corrupted or anything. If using Wubi 7.04, use these commands:

sudo fsck /media/windows/wubi/disks/system.virtual.disk
sudo fsck /media/windows/wubi/disks/home.virtual.disk

Otherwise, if using Wubi 7.10, use these commands:

sudo fsck /media/windows/ubuntu/disks/root.disk
sudo fsck /media/windows/ubuntu/disks/home.disk

Then mount the virtual disks, once the filesystems have been checked and repaired. If using Wubi 7.04, use these commands:

sudo mount -o loop /media/windows/wubi/disks/system.virtual.disk /media/wubi
sudo mount -o loop /media/windows/wubi/disks/home.virtual.disk /media/wubi/home

Otherwise, if using Wubi 7.10, use these commands:

sudo mount -o loop /media/windows/ubuntu/disks/root.disk /media/wubi
sudo mount -o loop /media/windows/ubuntu/disks/home.disk /media/wubi/home

Now you'll be able to access your wubi filesystem in /media/wubi read-write; your home dir will be in /media/wubi/home, and /media/wubi for the wubi root filesystem. You'll probably need to have root access to modify some files, so to open the filemanger with root privs:

gksudo nautilus /media/wubi

Optionally, if you need to do something like an apt-get to fix something, you can chroot in:

sudo chroot /media/wubi

And just run the commands you need to repair your install from within the shell that will then spawn. Once done with recovery, exit the shell and unmount the filesystems:

sudo umount /media/wubi/home
sudo umount /media/wubi
sudo umount /media/windows

Where's the source code for all this?

See https://launchpad.net/lupin for the source code for the Loop-Installer backend source, https://launchpad.net/wubi for the Windows-based Ubuntu Installer frontend source, https://launchpad.net/lubi for the Linux-based Ubuntu Installer frontend source, and https://launchpad.net/lvpm for the Loopmounted Virtual Partition Manager source.

Known issues

I get Grub Error 17 on reboot

Wubi uses a special version of the grub bootloader than does not overwrite to the Master Boot Record of your disks. It is called grub4dos.

  1. On installation it adds an entry in the settings of the ntldr boot loader of Windows 2000/XP/2003.
  2. On reboot it searches for wubi/boot/initrd and wubi/boot/linux.

This error means that grub can not read the partition where wubi resides, and can not find the initrd and linux files. There are mainly two known reasons for that (but it may also be that you hardware is not supported by grldr):

  1. Your drive is fragmented.
  2. Your NTFS drive is compressed.

In most cases uninstalling wubi and installing it to another drive will solve the issue. If that does not help enable the grub menu by editing c:\menu.lst and commenting out "hiddenmenu" and increasing the timeout to 10. When you see the grub menu press "c" to get the grub command prompt. Now you can see the world with the eyes of grub. Try to use the "find" command or the kernel command, hit the tab key at any moment for autocompletion and/or to have a list of available options

Your NTFS drive is compressed

Uncompress your whole drive (or at least wubi folder) using windows explorer, right click on the drive (or wubi folder), properties, advanced. Wubi should now uncompress the wubi folder for you.

Your drive is fragmented

Defragment your drive. Make sure that wubi/boot/linux and wubi/boot/initrd are not fragmented.

You can use jkdefrag for that.

  1. download http://www.kessels.com/JkDefrag/JkDefrag-3.8.zip

  2. unzip
  3. run: jkdefrag c:\wubi

Wubi is very slow when formatting virtual disks, it gets stacked at 33%

That phase should take from 1 to 10 minutes depending on virtual disk size and disk speed, any longer than that is an indication that we do not have the right driver included. That happens sometime with some more esoteric SATA drives. You have to check whether your HD is working at full speed. To do that press alt + F2 to get a terminal, then run the command:

hdparm -I /dev/sda 

You should see an asterisk close to udma, in a line like:

UDMA modes: udma0 udma1 udma2 udma3 udma4 '''*udma5'''

Note /dev/sda is a hard disk identifier you might have to use a different one. The most common ones are: /dev/sda, /dev/hda, /dev/sdb, /dev/hdb. You can use: grep host /proc/mounts to get a hint. If you do not have dma enabled let us know the make and model of your hard disk/controller and we will try to add the required driver.

If you have UDMA and still have the issue try one or more of the following. For 2-5 do this before rebooting.

  1. Uninstall and run wubi again, make sure that all virtual disks are smaller than 4GB
  2. Open a Dos shell and run: fsutil file createnew C:\wubi\disks\system.virtual.disk 4000000000
  3. If you have a large file (any one will do except an ISO or another virtual disks) of 3+GB, copy it on top of c:\wubi\disks\system.virtual.disk
  4. Cut and paste the C:\wubi\disks folder to another partition, and then cut and paste it back to C:\wubi.
  5. Defragament C:\wubi : download http://www.kessels.com/JkDefrag/JkDefrag-3.8.zip, unzip and run jkdefrag c:\wubi

Reboot and go on with the installation

Wubi Customization

Can you add Ubuntu-flavor-XYZ to Wubi?

Yes provided:

  1. Ubuntu-flavor-XYZ uses the same kernel as official Ubuntu (the kernel in the Alternate ISO)
  2. An alternate ISO URL is available

You need to send us:

  1. Alternate ISO URL
  2. Alternate ISO MD5
  3. Alternate ISO file size in bytes

Can I use Wubi installer with my Debian-based distro?

Yes, if the kernel is the same as Ubuntu we can just add your distro to the list (see above), otherwise you need to:

  • compile lupin on the target kernel
  • edit IsoList.ini in wubi sources to add a reference to your d-i based ISO (remove the other ISOs you do not want).

  • rebrand if you like
  • give us credit

Where is the source code?

You probably want to use the devel branches. You will find the sftp link in the page. The preferred method to get the code is to use bzr.

What license?

The code is distributed under [http://www.gnu.org/copyleft/gpl.html#TOC1 GPL version 2 and above], however, the Linux kernel itself is licensed under the GPL version 2 only.

WubiGuide (last edited 2014-04-22 12:19:13 by ya-bo-ng)