How to create Windows installer USB stick using WinUSB

A USB thumb drive with Windows ISO on it can be used to install Windows newly or repair an existing installation of Windows. Such a bootable USB stick can be created easily on Ubuntu:

  • Prepare the ISO of the version of Windows you want to install or use. For example, the Windows 10 ISO can be obtained here. If you are upgrading from a Windows 7 or 8, you can find out which version you are allowed to upgrade to here (check the Upgrade Editions section).

  • Note that common tools like Startup Disk Creator or UNetBootIn can only create installer USB sticks for Linux operating systems. They cannot be used for installing Windows.

  • An easy tool to create an installer USB thumb drive for booting Windows is WinUSB. It can be installed from a PPA:

$ sudo add-apt-repository ppa:nilarimogard/webupd8
$ sudo apt-get update  
$ sudo apt-get install winusb
  • Plug in your USB stick and use this command to make it a Windows installer:
$ sudo winusb --format /path/to/windows.iso /dev/sdc

Use the path to your ISO file and the device name of your USB drive instead of /dev/sdc in the above command.

You should be able to boot up and install Windows using this USB stick.

Tried with: Ubuntu 16.04

Advertisements

Windows booting to black screen

Problem

I upgraded a notebook with Windows 7 to Windows 10. It was working fine. I did a Windows Update and noticed that it installed an updated NVIDIA graphics driver. After a restart, Windows would boot only to a black screen. The mouse cursor would be visible and could be moved, but nothing else was displayed on the black screen.

Solution

Solution that did not work: Many online solutions advise to press Space and enter password, just as if logging in blind. This did nothing on my notebook.

Solution that worked: The solution provided by Microsoft here worked for me with some changes:

  • Download the Windows 10 ISO from here.

  • Create a bootable USB stick from this ISO. I used WinUSB as described here to create this in Ubuntu.

  • Boot the computer using USB stick. Go to Repair your computer -> Troubleshoot -> Advanced Options. I did not get the Restart option given in the above guide. Instead I chose to restore from an earlier recovery point, which thankfully was present.

  • Windows 10 was restored back to the time before the update.

  • To prevent such problems in future, I disabled Windows from updating my hardware drivers as described here.

How to mount and unmount ISO or IMG in Windows

Windows 8 or 10

Since Windows 8, there has been support in the OS for mounting an ISO or IMG file to a drive letter.

  • To mount, open Powershell and use Mount-DiskImage command:
$ Mount-DiskImage -ImagePath C:\MyFiles\foo.iso

Remember that you need to provide the full path to the file. The file will be mounted on the lowest available drive letter.

  • To unmount, open a command prompt with administrator privileges and use the mountvol command:
$ mountvol F: /d

Windows 7 and older

Windows 7 and older versions of Windows do not have internal support for mounting ISO or IMG file. Use the Virtual CloneDrive tool as described here to mount and unmount.

How to install Ubuntu from ISO file to VirtualBox on Ubuntu

It is sometimes useful to have one or more VMs of Ubuntu running on your native Ubuntu installation. For example, this can be useful for testing your code under certain software environments. One of the easiest ways to run VMs on Ubuntu is using VirtualBox.

It is pretty straightforward to setup a Ubuntu VM in VirtualBox. The only problem is to install Ubuntu from its ISO file into the VM. To do this, VirtualBox has to see the ISO file as a DVD disk that has been mounted from a (virtual) DVD drive. To do this:

1. Right-click on your VM and choose Settings > Storage > IDE Controller > Add CD/DVD Device.

2. Click on Choose disk and point it to your Ubuntu ISO file.

3. Now start the VM. it will boot from your ISO file and you can proceed with your Ubuntu installation on your VirtualBox.

Tried with: VirtualBox 4.1.12 and Ubuntu 12.04 LTS

How to mount and unmount ISO using Virtual CloneDrive

A lot of software is available as ISO files or IMG files and most folks would like to install this directly without having to go through the hassle of burning a DVD. This can be done by mounting the ISO file as a drive and installing from that drive.

Windows 7 and older Windows do not include the capability to mount a ISO file, but there are tools that offer this feature. The best I have found is Virtual CloneDrive. Download it, install it and any time you need to mount a ISO file, right-click it and choose Mount. When you are done and unmount it by clicking on the Virtual CloneDrive icon in the system tray.

Tried with: Virtual CloneDrive 5.4.6.0 and Windows 7 x64

How to mount or unmount a ISO file in Ubuntu

One option to mount and unmount ISO files in Ubuntu is to use the fuseiso package. First install the package using the name fuseiso.

To mount a ISO file, first create a directory where it can be mounted and then mount it:

$ mkdir dir-to-mount-iso
$ fuseiso foo-disc.iso dir-to-mount-iso

To unmount the ISO file, unmount the directory where it was mounted:

$ fusermount -u dir-to-mount-iso

Tried with: fuseiso 20070708 and Ubuntu 12.04 LTS

Make ISO using CDBurnerXP

DVD drives are becoming rare and it is a pain to store DVD discs of old software. One easy way to store them on hard discs is to convert each CD or DVD into an ISO file. That way, they can be virtually mounted whenever needed (like this).

Creating an ISO file from a bunch of files or directories is easy with CDBurnerXP. Open it and choose to make a data disc. Drag all the files and directories you want to be in the ISO from the top window to the compilation window at the bottom. Choose File → Save compilation as ISO file and you are done!

Tried with: CDBurnerXP 4.4.1.3243