none
How to create a Windows 7 USB (to install windows 7) from linux? (Using linux or a VM with windows) ?

    Question

  • I want to install Windows 7 professional 32 bit in my netbook , i know that i can. But i don't have a external dvd writer. Only some spare usb.

    I have a PC with Debian , and the netbook with debian too.

    What i want to do is buy it in microsoft , download the iso (i understand that is possible to select that option) , and then create a USB to install windows in the netbook,without need of use a dvd.

    I could download it to the netbook ,and then copy the iso to the pc , for example.

    I have been investigating a bit, and there are two or three posibilities.

    First , using virtualbox , create a VM , and install windows 7 in it , with the downloaded iso, then copy the iso to the vm , download the "Windows 7 USB/DVD Download Tool" and use it to copy the iso to the usb , but inside a windows 7 vm. Then use the USB to install windows 7 in the netbook.

    Second , Use dd (linux comand) to copy the iso to the usb.

    It would be something like :

    Open up a terminal, your going to need to find what device is your pendrive. If you have the drive mounted you can find the name of the device by typing "mount" and looking at it's entry. Something like the following:

    /dev/sdb1 on /media/USBDISK type vfat (rw,nosuid,nodev,uhelper=hal,uid=1000,utf8,shortname=mixed)

    In this case the first partion of /dev/sdb is mounted at /media/USBDISK. Open a root shell and unmount the drive.

    umount /dev/sdb1

    Go to the directory where your ISO is stored in a root shell and type in the following: (Replace windows7.iso with whatever the iso is called, and /dev/sdb with the device id of your usb stick).

    dd if=windows7.iso of=/dev/sdb

    If your motherboard supports booting off of a pendrive it should be able to boot off it. This will get the installer on the pendrive not the OS itself.

    This is what i have found in a comunity about servers and like.

    The only 'problem' is that this does require that your motherboard is able to boot USB-CD / USB-CDROM not just USB-HDD , but this shouldn't be a problem as , my netbook , in the boot section has,USB-CD,USB-HDD,USB-FDD, and a few more 'USB-something',so this method , i think could work, no ?

    A third method that i find is this:

    Not allways dd works.Basically, the missing step was to write a proper boot sector to the usb stick, which can be done from linux with ms-sys. This works with the Win7 retail version.

    Here is the complete rundown again:

    Install ms-sys

    Check what device your usb media is asigned - here we will assume it is /dev/sdb. Delete all partitions, create a new one taking up all the space, set type to NTFS, and set it bootable:

    # cfdisk /dev/sdb
    
    
    

    Create NTFS filesystem:

    # mkfs.ntfs -f /dev/sdb1

    Mount iso and usb media:

    # mount -o loop win7.iso /mnt/iso # mount /dev/sdb1 /mnt/usb

    Copy over all files:

    # cp -r /mnt/iso/* /mnt/usb/

    Write Windows 7 MBR on usb stick:

    # ms-sys -7 /dev/sdb

    ...and you're done.

    I suppose that my iso will be retail also ,and should work also.

     

    Anyone have some experience in creating a windows 7 usb from linux ?

    What is in your opinion the most reliable method ?

     

    I think i will try dd or perhaps the VM ,although i think dd should work. Windows 7 ISOs are like any other no ?

    If with dd you can copy a Debian 6 ISO to the usb ,and install debian using the usb (this is not supported ,or better said , yet implemented officialy by debian, but works, as i tryied it , and i could install it in the netbook), with the windows 7 iso should happen the same , no ?

     

    Any idea ? ( I cant get a external dvd writer, or use a windows laptop / pc,not with admin rights , nor be sure that hasn't any viruses / malware, that is a thing that worries me a lot).

    Thursday, March 10, 2011 5:02 PM

Answers

  • I personally am not very familiar with linux, but basicly all that you need to do... in whatever way you do it is the following:

    Format a usb flash drive, either fat32 or ntfs create a partition that is large enough to host the windows installation (give or take 3GB for 64bit, aroudn 2.5gb for 32bit) and mark that partition as active/bootable. Since this can be done with windows, but just as well with a tool like gparted, you should be able to do the same in debian.

    Once you have created that partition, mount the iso that you download, and copy all files starting from the root, into the root of the usb flash drive.

    That's all there's to it.

     

    Kind regards,

    Stephan Schwarz.


    If you one of these posts answered your question or issue, please click on "Mark as answer". If a post contained helpfull information, please be so kind to click on the "Vote as helpful" button :)
    • Marked as answer by Whitewolf573 Friday, March 11, 2011 4:27 PM
    Thursday, March 10, 2011 6:14 PM

All replies

  • I personally am not very familiar with linux, but basicly all that you need to do... in whatever way you do it is the following:

    Format a usb flash drive, either fat32 or ntfs create a partition that is large enough to host the windows installation (give or take 3GB for 64bit, aroudn 2.5gb for 32bit) and mark that partition as active/bootable. Since this can be done with windows, but just as well with a tool like gparted, you should be able to do the same in debian.

    Once you have created that partition, mount the iso that you download, and copy all files starting from the root, into the root of the usb flash drive.

    That's all there's to it.

     

    Kind regards,

    Stephan Schwarz.


    If you one of these posts answered your question or issue, please click on "Mark as answer". If a post contained helpfull information, please be so kind to click on the "Vote as helpful" button :)
    • Marked as answer by Whitewolf573 Friday, March 11, 2011 4:27 PM
    Thursday, March 10, 2011 6:14 PM
  • So there is not need of a virtual machine with windows 7 , and the ISO tool , just create a fat32 or ntfs partition,mark that partition as active/bootable.

    Then mount the iso and copy the iso content (not the iso itself , but the directory content where the iso was mounted) to the usb.

    The "WINDOWS 7 USB/DVD DOWNLOAD TOOL" i understand does this , it creates a new partition in the usb,makes active it , copy the iso content , but nothing more. Like a script , that makes all that steps for you instead of have to do all you.


    My father said that i can use his old Toshiba laptop with Windows vista (although i would use first the toshiba dvd to format the hdd and recover windows vista, as has a lot of programs not used , and perhaps some viruses) to create the usb, but i don't now if i really need it.

    The laptop has a Intel Centrino Duo,95 GB in c:, and 4GB RAM. (Windows vista 32 bit)

    Edited:

    I decided to format the toshiba (that has about 3 years), and create the usb using windows.

    Thanks for your help :)

    Friday, March 11, 2011 4:57 PM