Wednesday, April 4, 2012

How to migrate - updated for release 12.04 Precise Pangolin

A new version of the Wubi migration script will be released for Ubuntu 12.04 Precise Pangolin. There have been some minor changes that are required for release 12.04, and a few features added.

The simple migration hasn't changed

It's still straightforward to do a migration, for example if the target partition is /dev/sda5 and the swap partition is /dev/sda6, you can migrate as follows:
sudo bash wubi-move-2.2.sh /dev/sda5 /dev/sda6

New features

These are some of the changes with version 2.2 of the script:
  • Simplified interaction
  • Improved validation and diagnostics
  • Migrate to separate target partitions e.g. for / (root), /boot, /usr, and /home
  • Run migration validation pre-check without making any changes
  • Resume a migration that failed due to e.g. a corrupt file, without having to recopy everything
  • Synchronize a migrated install (e.g. to keep a fully bootable backup)

More information

For full instructions run:
bash wubi-move-2.2.sh --help

How to download

As usual, you can download the script from the HOWTO: migrate wubi install to partition thread on ubuntuforums.org. Select the file wubi-move-2.2.tar.gz, download, then right-click, and Expand. This will create a new directory with 3 scripts: wubi-move-2.2.sh, check-source.sh and check-targets.sh.

How to migrate in pictures






How to migrate from a root.disk

In the following example, the partition containing the root.disk is labeled 'wubi install' so the mountpoint is: /media/wubi install (including the space). This needs to be 'escaped' with '\' when specifying the location as shown in the screenshots below. Note also that this example uses a swap partition that is already used by another install (so option --shared-swap is specified to prevent running mkswap):


How to migrate to separate partitions

In the following example, there is a separate partition for /boot and /home in addition to the standard target (/) and swap partition. In addition, this example uses the  --shared-swap and --no-bootloader option:


Some notes on --resume and --synch

The new options --resume and --synch are designed to save time, either when the migration terminates due to rsync copy errors, or a refreshed migration is desired. Normally the script will only proceed on an empty partition (to prevent loss of data), so these options are the only way to bypass this - and they make use of rsync's sychronization ability to only copy files that are missing/changed.

Since this does introduce a little risk, these options rely on a control file created the first time the migration is started. This ensures that the target partitions are the same as on the prior run. In other words, resubmit the migration command in the exact same way, but append --resume on the end.

The idea behind the --synch option is to keep a bootable backup e.g. on an external drive. This can be quickly syncronized prior to performing major updates (like an release upgrade). 
Warning - synchronization will remove anything added to the migrated install that's not on the source install (in other words, don't use this option if you are actively using the migrated install).
This option is probably more useful for non-Wubi installs, so use it after you've migrated from Wubi (the script works on normal installs too).

Friday, March 23, 2012

Wubi disabled on live CD?

I wasn't going to blog about this... but since it made OMG! Ubuntu as a sensational article, I'd be remiss not to mention it.

Yes, it was floated on the ubuntu-devel mailing list to disable the ability to install using Wubi on the Ubuntu desktop CD. This didn't receive much discussion and so it's unclear what decision was made (if any), but I guess we'll find out soon enough with just a handful of weeks to go before 12.04 Precise Pangolin is released.

Background
Wubi.exe is released as part of the desktop CD ISO. This is fixed at release. So whenever you download the ISO you are getting the exact same one that others got on the release date... e.g. 11.04 - it's been out for a year, lots of updates, but the ISO is the same. Once you install Ubuntu 11.04, you'll be downloading 300+MB of patches. But since Wubi.exe is on the ISO it's also fixed for the duration of each cycle.

Why is this a problem? Wubi.exe typically gets limited testing during the development cycle. It doesn't get much development either - as the basic function doesn't usually change that much (11.10 was an exception to this). Most of this development tends to be after everything else is frozen, so the testing that was done early in development isn't always relevant. I could come up with other reasons, but you get the point. You're saddled with whatever bugs there are (some pretty irritating ones) - and even though many people download wubi.exe standalone, it's still fixed in stone.

Conclusion
So, in theory this is a great idea. We wouldn't have to live with irritating bugs, and instead of all the volunteers who support Wubi on Ubuntuforums.org having to repeat the same response 500 times, they could spend less effort making sure that the bugs are reported clearly so that a speedy fix can result.

However
It's still kind've nice to hand over a CD to someone and let them try out Ubuntu using Wubi, without having to download anything. I don't know how often this happens, but I guess there will be some who miss it. The question is, do you have to completely disable the CD install method to allow a stable release update to the standalone wubi.exe? Why not support both options?

Thursday, March 8, 2012

Wubi call for testing

We're about 7 weeks away from the next LTS release, 12.04 Precise Pangolin, and this is a critical phase to get all the Wubi bugs ironed out. The reason is simple: after the release Wubi.exe is not modified so we'll have to live with any bugs for at least 6 months.

Wubi development testing is typically under-represented by the Ubuntu community because it's mostly used by newcomers to Ubuntu (and many hardcore users don't have Windows). Wubi is the first impression of Ubuntu for many, and so it's important that this is a good experience. Since 11.04 was released, Wubi has been very stable, but there's always room for improvement and to get rid of any irritating bugs.

With that in mind there has been a call to testing on ubuntuforums.org. If you have the ability then please help out, and provide feedback in that thread and/or file bugs on https://bugs.launchpad.net/wubi/+filebug.

There are a number of ways to run Wubi tests:
1. Download wubi.exe and run it standalone (during dev you can get it from here)
2. Download the Desktop CD ISO, burn it to CD if it fits (or DVD), and run it from there.

Note: each time you install Wubi it uninstalls any existing Wubi install (so if you use Wubi normally you can't easily test it unless you are comfortable backing up your current install).

There are a few tricks you can use. E.g. running wubi.exe standalone will download the preinstalled images i386.tar.xz or amd64.tar.xz from here. That's a 500MB download each time you run it, so instead you can download it once, save it, and then point it at your local copy with a command line option. This saves a lot of time if you are repeatedly testing. e.g. for a 32 bit pc:
wubi.exe --dimagepath=C:\xxx\i386.tar.xz

You can also test the ISO install without burning a CD or DVD each time, by saving it in the same directory as wubi.exe (which you can get off the ISO or use the standalone download).

If you run wubi.exe standalone, but install something other than 'plain' Ubuntu it will always download the ISO instead of the disk image. You can also override this download by copying the ISO into the same directory as Wubi.exe, but note that since the ISO changes frequently in development, chances are it will try to download a new one anyway. To get around this (if you know the MD5SUM of your ISO is good,) you can disconnect from the Internet for the first part of the install.

Remember you can use Wubi to install:
  • Ubuntu
  • Kubuntu
  • Xubuntu
  • Mythbuntu
  • Lubuntu
  • Edubuntu
All of these need to be tested. For Edubuntu, you download the DVD ISO (there is no CD ISO), but for the others you need the Desktop CD ISO.

Pay attention to the latest wubi.exe revision .e.g as of the time of writing, the latest is wubi-r256.exe. This version won't install Edubuntu, but forthcoming ones will. And whenever a new revision is published it's important to retest to make sure the bug fixes work and make sure there are no regressions.

Good luck.

Tuesday, January 31, 2012

Wubi must overcome some hurdles for Edubuntu

From 12.04 you will be able to install Edubuntu with Wubi. There are a few hurdles to overcome. The first is that Edubuntu requires a DVD image to install, and Wubi has built-in checks to prevent this - the ISO must be < 900,000,000 bytes (or 858MB) .

These same checks are what prevents users from installing a normal desktop CD image from a USB stick. These days USB sticks are generally large - in fact the Ubuntu download site states that a minimum of 2GB free space is required when creating a bootable USB.
But the way Wubi works is to copy the entire USB partition as the 'ISO' during the installation, and following that it performs the 900,000,000 byte check, and fails.
There is another danger because the USB partition is copied without any space checks. So imagine if you have 10GB space left on your hard drive, Wubi proceeds to install, but then tries to copy a 16GB USB stick partition onto that same hard drive. (That can only end badly). And even if you have enough space - it's going to fail the size check anyway.

Why is this an issue? More and more users are using USB sticks as they are cheaper, readily available and much less hassle than CDs (bad burn anyone?). But even more importantly, there have been reports that the Ubuntu desktop CD ISO will be increased 750MB size from release 12.04 on. This rules out the use of standards CDs. You can still burn a CD ISO onto a DVD - that works because the ISO does not expand to the DVD size in the same way as with a USB partition.

Relevant bugs:
Edubuntu https://bugs.launchpad.net/bugs/913354
USB https://bugs.launchpad.net/bugs/461566

Friday, January 20, 2012

Wubi will support Lubuntu in release 12.04

Lubuntu
Coming with 12.04 precise pangolin, Wubi will support Lubuntu. Preliminary tests using the daily live CD and this wubi.exe are successful. Note you have to logon blind for now while bug 918401 is sorted out.

I found that Lubuntu ran very well on my junky old test laptop - while it was very sluggish with 11.10 Ubuntu. So Lubuntu might be a better option for older machines.

If you're going to be testing Wubi remember to use zsync to keep your test ISOs up to date. It's a great tool.

Other wishlist
It'd be nice if Wubi could install from a USB stick with 12.04 - since the desktop CD ISO is supposed to be around 750MB it won't fit on a CD so I expect many people will try with USB. Waiting on longstanding bug 461566.

Also, it'd be nice if some of the obscure error messages that have appeared since 11.10 could be replaced by human-understandable text. For example "WindowsBackend object has no attribute 'iso-path'". I suppose it's no better than 'Permission denied' being used indiscriminately, but I suppose we were used to that.

For the 'preinstalled image' install method, I'd like to see an easier way to override the kernel boot options for users with ATI or NVIDIA cards requiring 'nomodeset'.

From a personal point of view I'd like to have an installable Wubi migration gui app ready - but it's not looking like it will happen in time.

Wednesday, October 12, 2011

Oneric Ocelot 11.10 released

Update: Usually not much changes on the day of a release, certainly not on Wubi. However, it looks like a number of last minute changes were made, generating new revisions of wubi.exe, from revision 241 (which is the version on the current Oneiric CD ISOs) to revision 251, before it looks like they settled on release 245 (which is the version on the main Ubuntu.com download site). If you're wondering what that was all about, you're not alone, but from what I gather something to do with bugs installing Xubuntu/Kubuntu with Wubi. At any rate, my tests has been mostly on revision 241, and only on Ubuntu. If I become aware of outstanding issues, I'll create new posts to address that rather than redo my testing on multiple revisions of Wubi.

Now that 11.10 has been released there are a few things that can be documented:

Preinstalled images (1-stage install)
In the absence of an Ubuntu CD or downloaded CD image (ISO), wubi.exe will download a 'pre-installed' compressed image instead of the full desktop CD ISO. This saves about 200MB on the download and, more importantly, skips entirely the '2nd stage' install that Wubi users used to go through - a considerable time saving. Users will have to download and install some language packs separately though.

Differences
1. With the conventional 2-stage wubi install, you'd get a menu prior to the 2nd stage install - if you hit ESC during the 5 second countdown. From that menu you could select from 4 boot options, and also provide your own manual kernel boot option overrides. With the preinstalled image, this no longer works. If you need to supply kernel boot option overrides these will have to be done before rebooting by editing the file \ubuntu\install\wubildr-disk.cfg in Windows, specifically this line:
linux /vmlinuz root=UUID=$diskuuid loop=/ubuntu/disks/root.disk preseed/file=/ubuntu/install/preseed.cfg wubi-diskimage ro quiet splash <add options here>
Please note that if you don't have this file, you're likely doing the normal 2-stage install. For editing I recommend WordPad or write.exe as the line endings are linux style.

2. If you have Windows 7 and Microsoft Office's clickonce virtual drive Q: then you'll get a "Permission Denied" exception at the end of Wubi's windows (stage 1) installation. It's okay - it looks fatal - but it's not. Just reboot and it will work. (Note there are other reasons for getting Permission Denied - if you're unsure, review the log file wubi-11.10-rev24x.log in the %temp% directory).

3. There are still a couple of bugs on the preinstalled image. The /etc/fstab is not setup correctly, only containing a reference to the swap file, and even that is not valid (at least based on the traditional Wubi swap entry). The file system is also supposed to be ext4, but is currently still ext3. Fortunately, these 'preinstalled' images could probably be updated after release (although I have no idea if they'll be frozen like other release elements). 
FYI the current /etc/fstab looks like this:

# UNCONFIGURED FSTAB FOR BASE SYSTEM
/host/ubuntu/disks/swap.disk    none    swap    sw      0       0

It should look like this (once the image is corrected to ext4 you can adjust accordingly):

proc   /proc proc   nodev,noexec,nosuid   0 0
/host/ubuntu/disks/root.disk / ext3 loop,errors=remount-ro 0 1
/host/ubuntu/disks/swap.disk none swap loop,sw 0 0
Note: the bad /etc/fstab doesn't appear to cause any problems, at least, not that I've noticed in limited testing.



Normal 2-stage install
The conventional Wubi 2-stage install is still supported for offline installs, or when you run it from a CD. When wubi.exe detects a desktop CD ISO it will bypass the pre-installed image download (even if it rejects the local ISO it will download a new ISO).

Note: that the issue #2 for preinstalled images - the Permission Denied on the Q: drive - does not occur in this case.


Other notes
1. On Vista/Win7, when you reboot after the Windows intall stage is completed, it will boot into Ubuntu directly without presentation of the Windows Boot Manager (one-time only). This will happen even if you suffer from the bug where the 'Time to display operating systems' is set at zero (the symptom will be that it boots one time directly and after that, just straight into Windows) - for everyone else they'll see the windows boot manager at the next boot and thereafter (with Windows as the default).

2. Although Lubuntu is now an officially supported release 'flavour', and wubi.exe is included on the Lubuntu CD ISO - wubi will not support a Lubuntu install (although it is possible with some manual workarounds).

3. Ubuntu 11.10 introduces a new display manager (lightdm) which requires an update to the Wubi migration and resize scripts referred to in the Wubi Guide. These will be updated shortly following the release.

If you have any questions, go to https://answers.launchpad.net/wubi/+addquestion (launchpad account required) or http://ubuntuforums.org/newthread.php?do=newthread&f=331 (remember to prefix title with [wubi]). Also http://askubuntu.com/questions/tagged/wubi is a great resource - check if your question has already been answered first before posting on askubuntu.com.

Saturday, September 24, 2011

Oneiric beta and Wubi

I've been running Oneiric on Wubi since early on in development, and it has worked very well. But a few issues have come up with Beta1 and 2:
1. Offline installs are no longer working, and
2. The new Wubi pre-installed image doesn't work properly

Offline installs
When you're testing in development, it's best to use something like zsync to keep your Ubuntu installation CD ISO up to date - it changes pretty much daily as developers release package update frequently - and if you don't use zsync you have to download the whole desktop CD image (700MB) when zsync might only need 100MB. By placing the ISO and Wubi.exe in the same folder, you can install it easily and quickly. Even if the ISO isn't the latest, disconnecting from the internet will stop Wubi trying to download the latest.

But this is no longer working since Beta1. Wubi.exe no longer looks in the current directory - it just downloads the new pre-installed image (more about that later). There is a workaround... copy the ISO to the root of a partition e.g. E:\ and Wubi thinks it's a CD and will use it.

New install method
So what is this new install method? Wubi.exe used to download the desktop CD ISO when it was run standalone (and didn't find a suitable image in the current directory or other drives). Then it would preseed Ubiquity with some special instructions to format and install to the virtual disk. This means Wubi had a two stage install - first Windows, and second, the regular Ubuntu install (ubiquity).

New with Oneiric Beta, when Wubi.exe is run standalone, it downloads a pre-installed Ubuntu image and expands that on the virtual disk. So this removes the need for the second, Ubuntu install stage. It just boots the image it downloads, and the preseed file just contains the user info, which is used to setup the users account details.

So that's great - it's quicker to boot. But the problem is it's not quite working. The swap file is no longer setup, there is no /etc/fstab so performance can be sluggish. Another bug that didn't setup the grub.cfg on the new image has been fixed so hopefully these other issues will be fixed soon as well.
Note that the preinstalled image uses the ext3 file system (Wubi has used ext4 since release 9.10) - I'm not sure what the reason for this is.