How To Install Windows 10 On An External Hard Drive

I am not completely against to use dual-boot as a solution but if you are just low on disk space , using dual-boot as a solution can be annoying. In my case, I am using a linux based OS for my daily usage, but for some particular reason it turned out I have to use windows for particular software. However, using Windows as a virtual machine does not satisfy this particular software. So I decided to install windows10 on an old HDD that I am no longer using. Maybe you are in a situation similar to mine, or maybe you have one of the following reasons below:

  • You do not want to use dual-boot as your solution
  • You want to make a portable Windows OS
  • You do not have enough space on your main drive
  • or you are just looking for trouble

Requirements

  • Windows 10 ISO file
  • External Harddrive (SSD/HDD)
  • SATA to USB Adapter
  • Pre-installed host OS
  • Backup of your important data (OPTIONAL)
  • Bootable USB of your host OS (OPTIONAL)

Making a Portable Windows 10

For Windows Users

If you are using windows as an host OS, there are already lots of resources that can help you with this process. You can search with the keyword “Windows to Go” or you can check this write-up.

For Linux Users

Installing the Required Applications

  • VirtualBox
  • Gparted

In order to continue, you will need the above applications. Luckily, these applications are already exist in most of the linux repositories (if not all). Also in some linux distros gparted comes pre installed.

  • You can check if gparted is already installed on your system
    gparted --version
    
  • Installing the packages for Debian-based systems
    sudo apt install virtualbox gparted
    
  • For RHEL-based systems
    sudo dnf install virtualbox gparted
    
  • On Arch Linux and its derivatives
    sudo pacman -S virtualbox gparted
    

Creating a Windows 10 Machine

  1. Dowload the windows 10 ISO file from Microsoft’s website.
  2. Create a Windows 10 Machine with the virtualbox and install the Windows 10 by using ISO image. Check this detailed write-up if you need help with this process.

    Make sure that the size of the virtual machine’s size is not larger than your targeted drive.

  3. After the installation is complete, shutdown to guest.
  4. Go to the installation folder of the Windows 10 virtual machine.
  5. You should be able to see a file with “.vdi” extension, make sure that this file is exist.
  6. Run the following command in order to create image file.

     VBoxManage clonehd ["Windows 10.vdi"] ["win10.img"] --format RAW
    

    The first parameter is the name of your windows vdi file (not including the brackets). The second parameter is the name you decide to call the image file.

Lastly run this dd command to write the image to your pendrive.

sudo dd if=[win10.img] of=[/dev/sdc] bs=4M status=progress

This operation is going to copy the image file to your external drive. Again, the names in the brackets are variables. Replace those names with your actual file and location of the device on your system.

Just in case, open the gparted application in order to see if everything is ok with your drive.

  1. Select /dev/sdb from the dropdown menu on the right corner. img1

  2. If you can see your partitions and there is not any error indicated then you are ready to go. So you can skip the following steps.
  3. If you have a corruptted NTFS partition or getting other kinds of errors, before continue you should resolve that errors.

Remember that if you get a specific error you should search for that particular error. But just in case you encounter a corrupted NTFS partition, it might be useful this write-up.

Booting to Portable Windows 10

Configuring BIOS settings

  1. Reboot the computer while your external drive still connected to your computer.
  2. Press the BIOS key and go to the BIOS screen.

    BIOS key can vary up to the manufacturer, but in general common BIOS keys are F10,F2,F12,F1 or DEL.

  3. Change the related boot option from UEFI to Legacy, then save the settings and reboot. (Most likely in BOOT tab)

    Methods can vary depending on the BIOS firmware manufacturer. If you cannot find the settings in the BIOS, try to search with the name of your manufacturer.

  4. Now, you should boot up to the windows screen. Probably your disk will be checked and be configured, after that you should be landed to the login screen.

    If it not booting up to windows after changing the boot option from UEFI to Legacy, go back to the BIOS settings. Go to the boot options and make sure your external harddrive is the number 1 boot option.

So if you follow along with this write-up, now you should be able to use Windows OS as you wish.

Attention Please!

Never attemp to remove your harddrive before completly shutting down your computer, otherwise you can cause irreversible damage to your disk.

Booting up to Main OS

  1. Once you want to go back to main operating system of your choice go back to the BIOS settings.
  2. Revert the Legacy option to UEFI and disable the secure boot.
  3. Press Save&Exit, then reboot.

Booting up to Portable Windows 10

While booting to Windows 10 you need to follow the same steps again. For those who do not remember, here are steps to produce:

  1. Make sure the external drive is plugged into your computer.

    Computer status can be both shutdown or live.

  2. Go to the BIOS settings.
  3. Change the related boot option from UEFI to Legacy, optionally you can enable the secure boot.

  4. Save the changes and reboot, and you will be landed on Windows 10 login screen.

References

https://askubuntu.com/questions/889335/create-windows-to-go-usb-from-ubuntu https://www.makeuseof.com/install-virtualbox-on-linux-create-virtual-machine/ https://pureinfotech.com/create-windows-10-virtual-machine-virtualbox/ https://askubuntu.com/questions/47700/fix-corrupt-ntfs-partition-without-windows https://www.microsoft.com/tr-tr/software-download/windows10ISO