个人工具

Wubi

来自Ubuntu中文

Bt4wang讨论 | 贡献2008年11月1日 (六) 20:28的版本 不能启动 Ubuntu

跳转至: 导航, 搜索


目录

引言

Wubi logo.png

Wubi 是什么?

Wubi 是一个官方支持的 Ubuntu 安装工具,为 Windows 用户提供了一个如同安装其他 Windows 应用程序般简单而安全的安装途径。

如何使用本指南

请注意本指南仅针对使用 Wubi 安装的情况;如需常规的 Ubuntu 信息,请访问更合适的资源,如 Ubuntu 官方文档ubuntuforumsubuntuguide。也可访问Ubuntu 中文文档Ubuntu 中文论坛

您可登录 Wubi 官方网站获取 Wubi 的常规信息。或许您也会对 Wubi 论坛的内容感兴趣。

安装

如何安装 Ubuntu?

运行 wubi,输入新帐户的密码,然后点击“安装”。之后的操作均为自动执行。安装文件(700MB)将被下载到硬盘并执行校验,完成后程序会要求您重启计算机。重新启动后在启动选单中选择 Ubuntu。安装操作将继续执行 10-15 分钟并再次重启计算机。至此安装完毕,您可以在启动选单中选择 Ubuntu 并开始使用。

Wubi-123 zh.png

标准安装的默认设置可以满足大部分用户的使用要求。

如何选择运行 Windows 或 Ubuntu?

重启后,您可以在启动选单选择运行 Windows 或 Ubuntu。

Boot-screen.jpg

如何在没有网络连接的计算机上安装?

Wubi 可以使用 Ubuntu Desktop 8.04.1 Live CD 运行。Wubi.exe 已包含在该 CD 上。

如果您没有此 CD,请找一台能够连接 Internet 的机器,并下载 Wubi 及必需的 ISO:

下载完毕后将文件复制到没有网络连接的计算机中,所有文件都必须放置在相同目录下。随后运行 Wubi 执行文件。如果您的需要安装 Ubuntu 的计算机可以访问网络,只需下载 Wubi(第一个链接),Wubi 将自动下载其他必需的文件。

哪里可以找到旧版的 Wubi?

这里:http://sourceforge.net/project/showfiles.php?group_id=198355

如何使用手动下载的 ISO?

您需要下载与 Wubi 版本适应的 ISO。将 ISO 文件放置在 Wubi-X.XX.X.exe 文件的相同目录。执行 Wubi 即可开始安装。

请注意应当下载 CD ISO。DVD ISO 可能无法配合 Wubi 使用。

何时需要下载安装 Ubuntu AMD64 版?

如果您拥有一台 64 位的计算机;AMD64 版安装程序适用于 AMD 及 Intel 平台的 64 位计算机。

如何强制 Wubi 下载并安装 32 位版的 Ubuntu?

您可以预先手动下载适合的 32 位版本 ISO,并将它放置在 Wubi.exe 的相同目录;或着使用“--32bit”参数启动 Wubi。

如何强制 Wubi 安装在内存 <= 256MB 的计算机上?

您可以使用“--skipmemorycheck”参数运行 Wubi。在此情况下安装工具可能无效。

如何强制 Wubi 安装在空闲磁盘空间 < 5GB 的计算机上?

您可以使用“--skipspacecheck”参数运行 Wubi。安装最少要求 3GB 磁盘空间(加上存放 ISO 的空间),不要在更小的空间上尝试...

如何强制 Wubi 跳过 md5 校验?

您可以使用“--skipmd5check”参数运行 Wubi。

支持哪些操作系统?

Wubi 能够在 Windows Vista,XP 及 2000 操作系统上正常工作。Windows 98 应当也能支持,但没有深入测试。Windows ME 不被支持。Linux 操作系统可以使用 Lubi http://lubi.sourceforge.net/。

安装被中断后如何处理?

您应当在 Windows 中重新运行 Wubi(程序可能要求您先卸载 Wubi)。

升级

不支持从 7.04 升级至 7.10,因为 7.04 与 7.10 有重大改变。最佳的方法是删除旧版的 Wubi 并安装 Wubi-8.04(您可以保留原先安装的 Ubuntu 文件,并在 Wubi-8.04 中访问它们)或 使用 LVPM 将 7.04 系统文件移动至 a dedicated partition,然后 使用标准的 upgrade-manager 工具完成升级

可能支持从 7.10 升级至 8.04,但没有经过测试。

完全支持从 8.04 升级至 8.10。

卸载

如何卸载 Wubi?

在“添加删除程序”(Vista 为“程序和功能”)里运行卸载工具。或使用 C:\ubuntu\uninstall.exe(如果安装在其他分区,请将 C: 替换成相应盘符)。

Wubi-uninstall.png

如果卸载工具无效(Wubi rev 505),请尝试下载 Media:Uninstall-Ubuntu.zip 解压覆盖原文件并执行。

如何手动卸载 Wubi?

删除 C:\ubuntu(7.04 版为 C:\wubi,如安装在其他分区,请删除相应分区内的文件)及 C:\wubildr*(包括 C:\wubildr 及 C:\wubildr.mbr)。

对于 Windows XP,您需要编辑 C:\boot.ini 并删除包含 Ubuntu/Wubi 的行。对于 Vista,您可以使用 EasyBCD 编辑启动菜单。或者可以通过 控制面板 > 系统 > 高级 > 启动和故障恢复 点击“编辑”修改启动菜单。对于 Windows 98,您需要编辑 C:\config.sys,并删除 Wubi 的区段。

删除以下注册表键:HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Wubi,即可将 Wubi 从添加删除列表中移除。

如何重装 Wubi?

再次运行 Wubi.exe。Wubi 将检测现有的安装,并显示卸载的选项。您应当备份安装文件(ISO 镜像),以免重新下载的麻烦。请注意重装后,虚拟磁盘(root.disk)将被复位。

不支持的安装

软件磁盘阵列

软件磁盘阵列 raid 0 和 1 不被支持。它们将在 8.10 版中获得支持。请注意有些所谓“硬件磁盘阵列”,其实是软件的。

加密磁盘

加密磁盘不被支持。

Windows ME

Windows ME 不被支持。

代理服务器

Wubi 不支持 http 代理,使用代理将导致下载失败。这种情况下您应按前述内容的指导手动下载 ISO 并将它放置到 Wubi.exe 的相同目录。

DVD 及 Alternate ISO

DVD 及 Alternate ISO 或光盘不被支持。Wubi 8.04 使用的 ISO 必须是 8.04 CD Desktop ISO(最好让 Wubi 帮您自动下载)。对于 Wubi 8.04.1,则需要 8.04.1 Desktop ISO。Wubi 8.10 需要 8.10 CD Desktop ISO,以此类推。

问题处理

NOTE: Wubi 8.04.1 is now available here: http://wubi-installer.org this addresses most of the following issues that emerged after the 8.04 release. So if you have installation problems with 8.04 it is recommended to try 8.04.1 first. Note that it requires a new 8.04.1 desktop ISO available from http://releases.ubuntu.com/8.04.1/, you will not be able to reuse the 8.04 CD/ISO with 8.04.1.

无法读取光碟

此问题常发生在以下情况:使用了 DVD 盘片或驱动器,光盘已磨损,盘片质量低劣,CD/DVD 不是最终发布版本。Wubi 不一定要使用物理光盘,您可以从 http://wubi-installer.org 下载 wubi,并在光驱无盘的情况下运行。如果您已下载 ISO 文件,请将它放置在 Wubi.exe 的相同目录。

不能启动 Ubuntu

如果 Windows 没有正常关机,Ubuntu 可能不能启动。遇到这种情况,您应当在 Windows 中检查文件系统(目前 Linux 还没有与 chkdsk 相应的工具)。如果 Wubi 启动失败,请启动 windows,在安装 Ubuntu 的分区运行 chkdsk /r,正常关闭计算机并再次尝试启动 Ubuntu。

请注意 Windows 有时会将文件移动至一个隐藏文件夹 c:\found.000。您需要有 c:\ubuntu\disks\root.disk 及 c:\ubuntu\disks\boot 才能启动。如果这些文件不在该位置,请到 found.000 中寻找。您需要首先设置 windows explorer 以便显示隐藏文件,然后将文件从 found.000 移动回原来的路径。

请确认您没有在磁盘阵列或加密磁盘中安装。并且没有使用 Alternate 或 DVD ISO 安装。

Other boot or video problems

Some hardware is not fully compatible and Wubi will freeze upon booting (ACPI) and/or you may experience video problems. Those are not Wubi specific issues. There are generally special parameters that are required to enable workarounds for such hardware. If you press ESC at boot after selecting "Ubuntu" you will se a menu with more boot options. If the workarounds do the trick, we encourage you to notify the developers, so that a long-term solution can be investigated. For more boot options, once in the grub4dos menu, hit 'e' to edit the first line. Next select the second line and hit 'e' again. Input 'irqpoll' towards the end of the bootline. Then hit 'enter' and then 'b' to boot. Another option that might help is 'all_generic_ide'.

Installation error while formatting the swap file

If the installation fails while formatting the swap virtual disk it means that your drive is excessively fragmented. Uninstall, run jkdefrag on the target drive, then run wubi again.

不能卸载 Ubuntu

如果您在使用 Wubi rev 505,并且将 Ubuntu 安装在 C 盘以外的分区,卸载工具可能失效。遇到这个问题,请下载使用 Media:Uninstall-Ubuntu.zip。Wubi rev 506+ 没有此问题。

Cannot download the ISO file

This normally happens when you are behind a proxy server, sometimes the server might be down temporarily. In either case you can download the ISO manually as explained above.

Problems upgrading from 7.04 to 7.10

Upgrading from 7.04 to 7.10 is NOT supported. Upgrading from 8.04 to later versions is fully supported.

Video Problems after second reboot

If you experience problems after installation, press "Ctrl+Alt+F2" and run: sudo dpkg-reconfigure xserver-xorg Select the Vesa driver and leave all other options at default. Then reboot. That will allow you to boot into a safe graphic mode (limited resolution) you should then be able to install the appropriate drivers or try other solutions as appropriate.

Corrupted NTFS filesystem

All reported cases of damaged filesystems so far were from people that hard rebooted (pulling the plug). When you hard reboot, you can always damage your filesystem whether you use wubi or not. What happens is that new users sometimes get stacked with wubi/ubuntu and since they do not know what to do they tend to hard-reboot more often than necessary. Sometimes they get lucky, sometimes they do not. Since wubi sits on top of ntfs of course when they do not get lucky, ntfs gets corrupted. Sometimes people blame Wubi for that even though a quick googling will show you that there are tons of people experiencing ntfs corruption without having ever used wubi or ntfs-3g (and a full software industry lurking on that...), most of them after a hard reboot... If ntfs filesystem gets corrupted you have to run chkdsk /r from the windows recovery console on the Windows CD (or other recovery CD available on the web) or in the msdos console (if you can boot into Windows). At the moment there is no fsck for ntfs on the Linux side, otherwise it would be possible to fix errors automatically within Linux itself, as it happens for other filesystems, without having to rely on Windows tools. Best advise is to simply avoid hard rebooting. Whatever the OS.

Wubi Support Forum

If none of the above helps, feel free to ask for help on http://www.ubuntuforums.org/forumdisplay.php?f=234. It helps a lot if you can provide relevant logs when asking for support. Logs also speed up the process considerably. Note that you can install in "Verbose Mode" so that the logs will be even more complete. You will have to uninstall, reinstall, press "esc" at boot after selecting "Ubuntu", and choose "Verbose Mode". That will provide more detailed information.There are different Wubi logs:

  • Windows side installation logs are in your user temp folder (%temp%)
  • For grub errors, immediately after reboot, press the insert key rapidly after selecting Wubi and/or press esc at the countdown after selecting "Ubuntu" and use "c" or "e" to enter the appropriate boot options manually
  • For installation boot logs or if you end up in a busybox console, see /casper.log. You can use the commands "cat" and "more" to read the file.
  • For installation logs see /var/log/syslog and /var/log/installer within Linux and C:\ubuntu\installation-logs.zip within Windows. If you do not have C:\ubuntu\installation-logs.zip, uninstall, reinstall, select "verbose mode" at boot (see above). When the installer stops press CTRL+ALT+F2 and run: "sudo sh /custom-installation/hooks/failure-command.sh". You can now reboot into Windows, the logs should be in C:\ubuntu\installation-logs.zip
  • Post installation logs are in /tmp and /var/log/syslog

Bugs are tracked in https://bugs.launchpad.net/wubi.

Misc

Inclusion into official Ubuntu

Wubi was born as an independent project and hence the 7.04 and 7.10 versions were unofficial. But Wubi 8.04 is fully supported and it has been shipping within the Ubuntu Live CD with the 8.04 release.

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.

Can I back up the installation files?

Yes just copy C:\ubuntu\disks\root.disk somewhere else (in 7.04 the relevant files are called C:\wubi\disks\*.virtual.disk). Old installation files can be mounted within Ubuntu and any relevant data can be copied over the new installation.

How do I install multiple distros?

You can install your favorite distro from within Wubi (see the advanced settings) 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). You will not have to reboot to change the desktop, simply log-off and choose the desktop environment in the options at login.

Improving disk performance

Poor disk performance is usually due to a fragmented drive or to low memory (frequent swapping). You can use jkdefrag to defragment from within windows.

  1. download jkdefrag http://www.kessels.com/JkDefrag/
  2. unzip
  3. run: jkdefrag c:\ubuntu (or c:\wubi in 7.04)

What happens if I have another bootloader?

Wubi only changes the Windows bootloader. Chances are that your bootloader will chainload into the Windows bootloader. For instance, if you have Grub already, you will have to select Windows there, and then you will see Windows and Ubuntu. The chain of events goes like that: GRUB > NTLDR/BCD > GRUB4DOS > KERNEL

How big should the the virtual disks be?

The default size is calculated automatically based on your free space, you can change that in the settings. The space is not actually fully used, a barebone installation take less than 3GB 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. 8GB should be enough in most cases. Remember that on FAT filesystems the virtual disks cannot be larger than 4GB (Wubi will split larger allocations over several virtual disks). Remember also that Wubi requires a larger free space than the one required by the virtual disk themselves, that is because it has to grab an ISO (700MB) plus some headroom. So Wubi will not install if you have less than 5GB free.

How do I migrate to a real partition, and/or get rid of Windows entirely?

Existing Wubi/Lubi installations can be upgraded to an installation on a dedicated partition via LVPM. The main site for LVPM is at http://lubi.sourceforge.net/lvpm.html and the guide and support forum is at http://ubuntuforums.org/showthread.php?t=438591. As an alternative, the following script can be used with Wubi 8.04. Download attachment:wubi-move-to-partition Open a terminal and run:

sudo sh wubi-move-to-partition /dev/sda9 /dev/sda10

Replace /dev/sda9 with the partition where you would like to migrate the Wubi installation to, and /dev/sda10 with the appropriate swap partition (you can omit the second argument completely, in which case no swap will be setup). The two partitions must already exist and be empty (you can use any partitioning tool such as gparted to create them in advance). Note that the script will install grub as main bootloader replacing the existing bootloader, and it may not be easy to undo the changes (if things do not work as expected you will have to boot from a Live CD and replace/edit the bootloader manually). Also note that if you have multiple hard-disks, the disk order might have to be adjusted manually.

How do I resize the virtual disks?

You can use LVPM, at http://lubi.sourceforge.net/lvpm.html As an alternative, you can use the following script to move /home or /usr to a dedicated virtual disk. Download attachment:wubi-add-virtual-disk, open a terminal and run:

sudo sh wubi-add-virtual-disk /home 15000

Where the first argument is the directory to move to a new dedicated disk, and the second argument is the size in MB. The 2 directories you are most likely to migrate are /home (if you have a lot of user data) and /usr (if you installed a lot of software). You should now reboot. If you are happy with the result, you can now remove /home.backup. To undo the changes remove /home, copy rename /home.backup to /home and remove the /home line in /etc/fstab.

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 /host/ubuntu/disks
sudo dd if=/dev/zero of=extra.disk bs=1MB count=1 seek=10000
sudo mkfs.ext3 -F extra.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 "root.disk", "home.disk", "swap.disk" or "extra.disk". That's the wubi equivalent of buying (and installing) a new hard disk ;) 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 access the Windows drives?

The Windows partition where you installed Wubi is available as /host within Ubuntu All the other partitions will be available under /media/ If you are using Wubi-7.04 (7.10 and 8.04 users can skip this), write support for ntfs is disabled by default, to enable it:

  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 can I access the Wubi files from Windows?

There are a few Windows applications that can mount ext2-based file systems. See for instance:

The relevant Wubi files you need to access are located under C:\ubuntu\disks\

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

Boot the Ubuntu Desktop CD, or another LiveCD, then mount the windows partition:

sudo mkdir /win
sudo mount /dev/sda1 /win

Replace sda1 with the appropriate device (a == disk, 1 == partition number), then mount the virtual disk therein

sudo mkdir /vdisk
sudo mount -o loop /win/ubuntu/disks/root.disk /vdisk

Now the content of the virtual disk will be visible under /vdisk. 7.04 users will have to install ntfs-3g first and specify it as fstype to gain r/w access. To check the filesystem you can use:

sudo fsck /win/ubuntu/disks/root.disk

How to reboot cleanly even when the keyboard/mouse are frozen

There are normally several ways to reboot cleanly using key combinations such as:

  • CTRL + ALT+ F2 (get to a terminal, you can then run top/kill/pkill to discover and kill the offending process)
  • ALT+ SYSRQ + R then CTRL + ALT+ F2 (as above, but first try to regain control of the keyboard)
  • CTRL + ALT + Backspace (kills the graphic session and goes to a console, all graphical applications are terminated too)
  • ALT+ SYSRQ + R then ALT + Backspace (as above, but first try to regain control of the keyboard)
  • CTRL + ALT + DEL (reboot)
  • ALT+ SYSRQ + R then CTRL + ALT + DEL (as above, but first try to regain control of the keyboard)
  • ALT+ SYSRQ + R + S + U + B (forces a clean reboot even when the keyboard is not responding)

The last one is the most effective, but you could try the other commands first.

Wubi Customization

Can you add Ubuntu-flavor-XYZ to Wubi?

If you want your distribution included into the official release of Wubi, that needs to be approved. A live CD ISO must be available to do that (Wubi uses a ubiquity based installer).

Can I recompile my own version of Wubi to support my Ubuntu-based distro?

Yes, Wubi can be easily rebranded and modified. Get the wubi source code and modify the files in the ./data directory as you see fit. In particular you may want to change isolist.ini and the artwork (image names have to match the headers in isolist.ini). To compile on a Debian based system run:

make prerequisites #only to be done once
make
make test #to test the installation within wine

Can I use Wubi for non-Ubuntu based distributions?

It should be fairly straightforward to modify the frontend (feel free to ask if you need any help), as shown above. Your Linux distribution must have a mechanism to do unattended installation using a preseed file. Wubi takes advantages of debian-installer/ubiquity preseeding, if you use a different mechanism, you will have to modify src/wubi/installer_preseed.nsh. The make prerequisite scripts might need to be updated a bit too since they are debian specific. Note that upstream files (Linux-side) need to be changed as well since normal distributions are generally not capable of targeting and booting (and rebooting) off a loop device. This task was originally accomplished by the Lupin project, but since 7.10 a lot of functionality has been moved upstream. Hence you might want to have a look at:

Where is the source code?

What is the license?

The code is distributed under GPL version 2 and above, however, the Linux kernel itself is licensed under the GPL version 2 only.