Install Windows 7 in Ubuntu

Source: Internet
Author: User

Today, my colleague brought a Lenovo notebook with a pre-installed javast11.10 and asked me to install a Windows 7 System for him. There is no optical drive on the computer. The first thing that comes to mind is that Windows 7 is installed on USB. I asked another colleague for a system USB flash drive, but faced a problem that I needed to partition the hard disk. By default, the device divides the hard disk into three areas: "/", "/swap", and "/Home", so there is no space available. In this case, partitioning in the Ubuntu system is definitely not feasible. I first thought of installing puppy Linux and then Partitioning in putty. I originally wanted to install puppy on a USB flash drive. Later I wanted to boot puppy directly under Ubuntu.

For how to boot puppy Linux under Ubuntu, refer to here: http://blog.kreatx.com/2011/12/16/dual-boot-puppy-linux-with-ubuntu/

The guiding item content should also be added:

 
Set root = (hd0, msdos8) search-f -- FS-UUID -- set <UUID value of the partition where you store puppy> // you need to add this sentence...

Here, the partition problem is solved. Insert a USB flash drive to install Windows 7Program. The problem arises again. After you enter the installation page, you will always be prompted that the CD/DVD drive cannot be found. One Google search, a lot of feedback, probably because the installation file in the USB flash drive is damaged.

What should we do next, and re-create a USB win7 installer?

I have installed Ubuntu, UBUNTU boot win7, and win7 boot Ubuntu under various circumstances. I think of the strength of grub, and I am afraid that I can install win7 on Ubuntu. After a review of the search results, it is still feasible. Some people have practiced it. Let me make a summary here.

 

Install Windows 7 in Ubuntu:

Download grub4dos, mount the window7.iso file on the terminal, copy all the files to the root directory of a certain NTFS or FAT32 partition, and restart the computer. Go to the system boot menu, and press up and down to stop automatically entering the system. After stopping, press the e key to enter the command line mode.

 
Set root = (hdx, Y) // X indicates the hard disk ID, and y indicates the partition ID. For example, I use (hd0, 0) Linux/grub.exe

Now go to grub, still in command mode

 
Grub> Find -- Set-root/bootmgrgrub> chainloader/bootmgrgrub> boot

OK. Now, go to the Windows installer.

 

When I create a new partition, I split the hard disk partition where/home is located. As a result, UBUNTU cannot log on to the system, and then uses the recovery mode to copy files using shell.

Use shell to install Windows 7 in Ubuntu recovery mode

Now the Windows 7 isofile and grub.exe are ready in the USB flash drive. When you enter the system boot menu, select recover mode and select "drop to root shell ". After entering the root shell, you will notice that the entire file system is read-only. To modify the configuration file, you must re-mount the file system to read/write:

 
# Mount-n-o remount, RW/

First, check the location of the USB flash drive.

 
# Fdisk-l

You can see that the hard drive is mounted to the USB flash drive:/dev/sdb1:

 
# Mkdir/mnt/USB # Mount-T Auto/dev/sdb1/mnt/USB

Beibeigrub.exe to "/" directory:

 
# Cp/mnt/USB/grub.exe/

Mount the ISO file and copy all the files to the root directory of a partition (/dev/sda3. Note that the partition format must be NTFS or FAT32, and it is not the target partition to install win7 ):

 
# Mkdir/mnt/win7 # Mount/mnt/USB/window7.iso/mnt/win7-o loop # mkdir/mnt/Windows # Mount-T auto/dev/sda3/mnt/Windows # cp-R/mnt/win7 // MNT/Windows

Restart:

 
# Reboot
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.