1

How can I create a virtualized windows (preferably W10) OS on Ubuntu? I want to just purchase a license and have a VM that I can keep indefinitely.

Basically, I just want to have a full Windows OS that I can utilize on my Ubuntu machine. I don't want to dual boot, and I need to use my Ubuntu OS at the same time (i.e. I need to be able to switch between OSs instantaneously as well as utilize Windows in a window and instantaneously share files, clipboard etc between both).

I just need a totally normal Windows OS that I can access in a window while my Ubuntu OS is running.

I've had success with the Windows development environment in Virtualbox, this meets my needs perfectly, but isn't an effective solution because the license expires. I'd like to just purchase a license and keep the Windows development environment, but I'm just not sure if this would work or not and I've struggled to find clear information on the internet about this.

Thanks in advance.

Edit: the ReactOS project is interesting, but I don't believe it supports multithreading and I'm just going to assume that at least one of my Windows apps will be incompatible; I'd love to go that route but I just don't believe it will work from what I've read.

Edit: one significant concern I have is that I'll create a VM and spend the money on the license only to later have that license permanently invalidated, or that the license will somehow be invalidated via creation of the VM. I'm just not familiar enough with how Windows licensing works to be confident that I'm not going to mess up somewhere and waste money.

6
  • 1
    All you should have to do is buy any windows licence and then activate windows with it. You should be able to buy a licence from within the Windows Store in your virtual machine.
    – Mokubai
    Commented Feb 26, 2022 at 15:23
  • Hi @Mokubai, thanks for your response. I'm glad it is that easy. If I purchase a license, is there anything that could invalidate the license? Will the license be limited to the one machine?
    – quantif
    Commented Feb 26, 2022 at 15:29
  • @DanielB, do you mean creating a VM from an iso or something of that nature? Sure, it's just that I don't know if that will work or not, don't want to waste my money if there's something I don't understand
    – quantif
    Commented Feb 26, 2022 at 15:30
  • when I go the Windows store on my W11 dev VM, it says "You're running Windows 10 and you're all set" and I'm not seeing an option to purchase a license. (not sure why it says W10 instead of W11).
    – quantif
    Commented Feb 26, 2022 at 15:40
  • @quantif you may want to have a look at ebay. You can get activation keys from decommissioned machines for under 10 bucks. They are perfectly valid and it is not necessary to pay microsoft a premium. Commented Feb 26, 2022 at 16:27

1 Answer 1

2

You can do that with any virtualization solution. While virtualbox would work fine, I would recommend KVM/QEMU with virt-manager as frontend.

QEMU/KVM installation

Note that you need to enable virtualization extension support in your UEFI/BIOS. Intel calls it VTx while on AMD it is called SVM. Make sure that you also enable IOMMU if present.

KVM (kernel virtual machine) is integrated into the linux kernel, while libvirt/QEMU provides an interface for communicating with KVM.

KVM is a type 1 hypervisor, which means that it runs directly on the hardware. This eliminates resource overhead in contrast to type 2 hypervisors like VirtualBox, resulting in lower latency and a overall higher performance.

1. Install qemu

apt install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils

2. check KVM CPU support

kvm-ok

The output should look as following:

INFO: /dev/kvm exists
KVM acceleration can be used

You should reboot your system now to make sure everything goes smoothly.

3. install and launch virt-manager

We will use virt-manager as GUI frontend for controlling our virtual machines. Install it as following:

apt install virt-manager

And launch it with virt-manager

It will ask you for your sudo password then.

4. get required ISOs

You can download an official Windows 10 ISO from microsoft.

We also need the virtio drivers for Windows to recognize the virtual disks.

You can find the latest stable version here.

5. create virtual machine

After you've started virt-manager, simply click on the button with the green frame to start the VM creation wizard.

wizard

Choose the downloaded ISO and select Windows as operating system.

Configure disk size as well as CPU and RAM. Note that you can change CPU and RAM as well as any peripheral device without any problems at a later stage.

5.1 mount virtio drivers

Windows is by default not able to detect the attached virtual disk. During installation you can select a CD with the necessary drivers, for that you need to mount the previously downloaded virtio-win-xxx.iso on a second virtual CD drive.

  1. open VM configuration

vm config

  1. click Add Hardware

enter image description here

  1. select storage and change Device type to CDROM

enter image description here

  1. click on Manage to select the media for the new device

enter image description here

  1. select the virtio ISO and click "Choose Volume"

enter image description here

6. start the VM

Simply double-click on your newly created VM in virt-manager and click on the Play button on top of the new window to start the VM.

enter image description here

7. install Windows

i will not go further into detail on this step, it should be fairly self explanatory. Note that during partitioning, you need to select to load drivers from external media to load the virtio drivers. Otherwise the virtual disk cannot be found.

7
  • very nice tutorial @mashuptwice, thanks, the web needed this, I'll do this soon. one thing: will I be able to modify the resource allocations after creating the VM, without invalidating the license? I have a multithreaded CPU intensive process I run on Windows sometimes, want to be able to expand and contract CPUs allocated between OSs.
    – quantif
    Commented Feb 26, 2022 at 16:07
  • @quantif you can change CPU cores and RAM without any problems afterwards, as long as the VM is shut down. I've added that info to the guide. Commented Feb 26, 2022 at 16:29
  • @masuptwice when I first ran virt-manager I got a "not connected" message, but this went away after restarting and then running sudo apt update. not sure if this should be added to the instructions or not.
    – quantif
    Commented Feb 26, 2022 at 17:02
  • @quantif Thanks for the suggestion, I will do that. Commented Feb 26, 2022 at 17:31
  • I'm not sure why, but I (accidentally) skipped the part about installing the virtio drivers, and I'm up and running now. haven't gotten shared folders working, but apparently that is a bit complicated on KVM.
    – quantif
    Commented Feb 26, 2022 at 19:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .