Running several versions of Windows from the SAME VM config


  1. Posts : 11,246
    Windows / Linux : Arch Linux
       #1

    Running several versions of Windows from the SAME VM config


    Hi folks

    @sat2022

    Delving a little more into VHDX files (Physical ones) it seemed to me that if you want to run various builds of Windows on essentially the same PC as Virtual machines - there's no reason why the Virtual machine boot couldn't offer the boot choice of these Virtual machines Note you can't run them all simultaneously - for that you will need a config file for each virtual machine.

    So ONE virtual machine definition gives you choice at start up of what Windows build you want to boot .

    Running several versions of Windows from the SAME VM config-screenshot_20220123_143420.png

    Voila !!!!

    So I'm using a Linux Host and running KVM/QEMU as the virtual machine sofware

    So what you do is : (assuming you;ve installed KVM/QEMU and it's working. This is a Windows 10 forum so google if you aren't sure about installing KVM and enabling networking between HOST and VM.

    1) obtain the windows ISO for the windows build you want to install

    2) create a virtual machine with say 200GB of HDD space (I'm using an external SSD device but any will do -- my Windows VM's are around 45 GB each so enough for 4 systems on this disk). Only do this ONCE !!!.

    3) start VM by booting t the ISO ->repair windows->command mode

    4) now prepare the HDD -- std windows commands -- you are automatically in Windows Admin / elevated mode

    Diskpart
    select disk xxx
    clean
    convert gpt
    create partition efi size=100
    format fs=fat32
    assign letter=S
    create partition msr size=128
    create partition primary
    format fs=ntfs quick
    list disk
    select disk xx where xx is the complete "big disk"
    assign letter=g (unless letter is assigned automatically)

    now create vhdx files for each windows system you want to install

    create vdisk file=g:\W10.VHDX maximum=50000 type=fixed
    attach vdisk
    list disk
    select disk=yyy where yyy is the "vdisk" just attached and create single std partition - no efi or anything needed
    create partition primary
    format fs=ntfs quick
    assign letter=w

    exit.

    Now install Windows on it -- assume the iso is mounted on E and assuming the image file is nr 1 (check though via) imageinfo if you have more than 1 image

    dism /Apply-Image /ImageFile:e:\sources\install.wim /index:1 /ApplyDir:w:\

    after that completes you need to apply the boot loader

    cd w:\windows\system32
    cd w: to ensure the bcdboot command is run from the windows system you want to install

    bcdboot w:\windows /s S: /f UEFI

    exit

    shut down the VM, switch boot from ISO image to the HDD and boot

    you should then boot into the default Windows build if only one file, otherwise you'll see the boot choices as per standard windows.

    Note the actual "Physical" disk on the HOST doesn't need itself to be formatted GPT - in fact better not to. The "Big Virtual disk" needs an EFI partition (and will work even if the HOST is a MBR only machine).

    note for secure boot (Windows 11) and efi generally in the VM install package edmk on the host.
    If you download the latest virtio drivers just install them on the GUEST - note the latest version also has W11 drivers too.

    Incidentally if you add another partition to the "Big Disk" there's no reason why you can't also use GRUB to boot Linux VM's as well.

    I only use this for Windows VM's -- works brilliantly IMO. One VM config for all those Windows builds -- just change / add / delete the vhdx files as per choice.

    Have fun !!

    Cheers
    jimbo
    Last edited by jimbo45; 23 Jan 2022 at 09:38. Reason: added screenshot of Windows multiboot with inVM
      My Computer


  2. Posts : 777
    Windows 10
       #2

    Do you think it'd be appropriate to name this 'A guide to Running several versions of Windows from the SAME VM config'?
      My Computer


  3. Posts : 11,246
    Windows / Linux : Arch Linux
    Thread Starter
       #3

    James said:
    Do you think it'd be appropriate to name this 'A guide to Running several versions of Windows from the SAME VM config'?
    Hi there

    @James

    The point of this was to emphasise that only 1 Virtual Machine needs to be defined (The Generic one with the large disk space). Then from WITHIN that VM you can define vhdx files on the large disk and install the windows versions you want.

    I want to distinguish between having to define different VM's even though they could use a copy of the same config i.e on your computer you see several VM's defined - whereas this one simply has ONE VM defined and boots the appropriate vhdx windows system. Note these are NOT 2nd level VM's so performance is fine and uses native Ms's Disk I/O for the physical vhdx files.

    So the Host only has 1 VM defined (OK it's called W10 because I installed that as default but can boot either at power on of the VM the bcdboot menu shows W10 and W11)

    Running several versions of Windows from the SAME VM config-screenshot_20220123_171602.png
    After starting the VM you get this :

    Running several versions of Windows from the SAME VM config-screenshot_20220123_143420.png

    In the VM the Windows system is running on C, the vhdx files are on D which is the storage disk defined in the VM config and if I need Host access I've attached a network drive (Z). Only the D device is defined in the VM config on the Host

    Running several versions of Windows from the SAME VM config-vm.png

    The "D" volume has these files on it only and these are created via diskpart create virtual disk when the OS in installed by using the command mode from the windows install iso or a winpe system.

    Running several versions of Windows from the SAME VM config-vm1.png

    Cheers
    jimbo
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 02:34.
Find Us




Windows 10 Forums