Windows 10: Using Physical Disk in KVM/QEMU Windows VM

Discus and support Using Physical Disk in KVM/QEMU Windows VM in Windows 10 Virtualization to solve the problem; Hi there If you have a spare external (or even internal) HDD / SSD that you want to use as a "Physical" Disk drive say on a Windows VM using native... Discussion in 'Windows 10 Virtualization' started by jimbo45, May 23, 2021.

  1. jimbo45 Win User

    Using Physical Disk in KVM/QEMU Windows VM


    Hi there If you have a spare external (or even internal) HDD / SSD that you want to use as a "Physical" Disk drive say on a Windows VM using native ntfs for exampleso you can unplug it later and connect to a Windows physical machine etc to copy data etc then it's easy enough to do. 1) ensure the disk is not mounted on the Host 2) edit the Windows xml definition file in the libvirt/qemu directory (virsh edit or whatever you use to edit xml files) and add the disk definition. File is in /etc/libvirt/qemu and the name is the name of your Windows VM. </disk> <disk type="block" device="disk"> <driver name="qemu" type="raw"/> <source dev="/dev/sdg"/> <======= whatever the device is on your system -- lsblk will show devices <target dev="vda" bus="virtio"/> (for 2nd virtio device then replace vda by vdb etc ) # <address type="pci" domain="0x0000" bus="0x06" slot="0x00" function="0x0"/> this line is generated when the VM is booted so you don't enter this one </disk> 3) if device hasn't been partitioned or whatever in windows then use in the Windows VMwindows as admin diskpart -> list disk ->select disk nn ->clean ->convert gpt ->create partition primary ->format fs=ntfs quick ->list vol ->selct vol xx ->assign then exit Now it's available as native NTFS drive (the GPT step is optional but I prefer using gpt drives) on the Host you can see now the disk (after powering off the VM is indeed NTFS). You will need to dedicate a whole disk for this though as a partition isn't a block device. In this case the windows ntfs data is on /dev/sdg2 and it can be plugged in to any windows system. This is useful when you need to capture things like WIM image, take system backup , copy large bits of data from the VM - where a USB stick is not large enough etc etc and want to use it on other Windows physical machines - saves defining large virtual disks and the other Windows machines you want to use the data on might not be "network acessible". Cheers jimbo

    :)
     
    jimbo45, May 23, 2021
    #1
  2. jimbo45 Win User

    Using Physical Disk in KVM/QEMU Windows VM

    Hi there
    If you have a spare external (or even internal) HDD / SSD that you want to use as a "Physical" Disk drive say on a Windows VM using native ntfs for exampleso you can unplug it later and connect to a Windows physical machine etc to copy data etc then it's easy enough to do.

    1) ensure the disk is not mounted on the Host

    2) edit the Windows xml definition file in the libvirt/qemu directory (virsh edit or whatever you use to edit xml files)
    and add the disk definition. File is in /etc/libvirt/qemu and the name is the name of your Windows VM.
    </disk>
    <disk type="block" device="disk">
    <driver name="qemu" type="raw"/>
    <source dev="/dev/sdg"/> <======= whatever the device is on your system -- lsblk will show devices
    <target dev="vda" bus="virtio"/> (for 2nd virtio device then replace vda by vdb etc )
    # <address type="pci" domain="0x0000" bus="0x06" slot="0x00" function="0x0"/> this line is generated when the VM is booted so you don't enter this one
    </disk>

    3) if device hasn't been partitioned or whatever in windows then use in the Windows VMwindows as admin diskpart -> list disk ->select disk nn ->clean ->convert gpt ->create partition primary ->format fs=ntfs quick ->list vol ->selct vol xx ->assign

    then exit

    Now it's available as native NTFS drive (the GPT step is optional but I prefer using gpt drives)

    on the Host you can see now the disk (after powering off the VM is indeed NTFS).

    You will need to dedicate a whole disk for this though as a partition isn't a block device.

    In this case the windows ntfs data is on /dev/sdg2 and it can be plugged in to any windows system.


    Using Physical Disk in KVM/QEMU Windows VM [​IMG]


    This is useful when you need to capture things like WIM image, take system backup , copy large bits of data from the VM - where a USB stick is not large enough etc etc and want to use it on other Windows physical machines - saves defining large virtual disks and the other Windows machines you want to use the data on might not be "network acessible".

    Cheers
    jimbo
     
    jimbo45, May 23, 2021
    #2
  3. W1zzard Win User
    qemu-kvm

    i'm missing some kind of free gui based management thing for qemu-kvm that lets me do common VM tasks
     
    W1zzard, May 23, 2021
    #3
  4. Using Physical Disk in KVM/QEMU Windows VM

    qemu-kvm

    virt-manager is the gui that can be used to do exactly this.

    from the open source project:QEMU is a generic and open source machine emulator and virtualizer.

    When used as a machine emulator, QEMU can run OSes and programs made for one machine (e.g. an ARM board) on a different machine (e.g. your own PC). By using dynamic translation, it achieves very good performance.

    When used as a virtualizer, QEMU achieves near native performances by executing the guest code directly on the host CPU. QEMU supports virtualization when executing under the Xen hypervisor or using the KVM kernel module in Linux. When using KVM, QEMU can virtualize x86, server and embedded PowerPC, and S390 guests.
     
    Easy Rhino, May 23, 2021
    #4
Thema:

Using Physical Disk in KVM/QEMU Windows VM

Loading...
  1. Using Physical Disk in KVM/QEMU Windows VM - Similar Threads - Using Physical Disk

  2. Idiot's guide to creating a Win2GO Windows from KVM/QEMU VM (V2P)

    in Windows 10 Virtualization
    Idiot's guide to creating a Win2GO Windows from KVM/QEMU VM (V2P): Hi there Easy now. Pre-reqs : 1) Bootable version of Macrium Free (use create stand alone recoverable media) on USB and Macrium Free installed in the VM. (It's easier this way). 2) A copy of a running version of Windows\System32\DriverStore from a physical Windows system --...
  3. capture WIM image of KVM W10 VM for convert to physical (V2P)

    in Windows 10 Virtualization
    capture WIM image of KVM W10 VM for convert to physical (V2P): Hi folks @Hopachi one for you as well to try out !!! I've got a great running W10 KVM virtual machine running with all the software working etc -- so I would like to capture the WIM image via DISM. Also I'd like all the software etc on a Windows ISO so I don't have to...
  4. Windows activation in KVM/qemu virtual machine

    in Windows 10 Updates and Activation
    Windows activation in KVM/qemu virtual machine: Hello, I have a problem with the activation of Win10 Pro. I have a digital license win7 upgrade in 2015 or something like that... I reinstalled my virtual machine with some new tweaks etc. the problem is now that I cannot activate Windows anymore with my Microsoft account...
  5. W10 VM on W2K19 VM on KVM Host !! nested VM's

    in Windows 10 Virtualization
    W10 VM on W2K19 VM on KVM Host !! nested VM's: Hi folks So far got HYPER-V to run on a Virtual machine creating a lower level W10 VM - The W2K19 machine is itself a VM running on under KVM/QEMU So far only got Gen 1 to work -- with Gen 2 machine starts but no video - will look at that later but here's the Gen 1 VM So...
  6. KVM/QEMU users - creating a Network Bridge

    in Windows 10 Virtualization
    KVM/QEMU users - creating a Network Bridge: Hi folks Those of you running a Linux host and wanting to run Windows VM's using KVM/QEMU then provided you've got a wired connection you should make a network bridge otherwise your VM will only be able to use NAT with connection limitations. so ensure net-tools and...
  7. W10 VM Bridged networking QEMU/KVM (External Switch)

    in Windows 10 Virtualization
    W10 VM Bridged networking QEMU/KVM (External Switch): Hi folks Really SIMPLE way of getting Bridged networking to work in QEMU KVM for proper VM access to rest of your LAN -- equivalent to external switch in HYPER-V Note you need to do this after re-boot from host each time --you can set a script etc for permanence but as I...
  8. Networking on Windows VM from KVM/ QEMU Host via Bridge

    in Windows 10 Virtualization
    Networking on Windows VM from KVM/ QEMU Host via Bridge: Hi folks For those running Windows VM's on Linux Hosts and want to try the Linux Hypervisor (VMWare and VBOX will run concurrently so you don't even need to power off any running Windows VM's) with decent networking you need to set up a network Bridge (roughly analogous to...
  9. Esxi users -- using RAW (physical ) disks in VM's

    in Windows 10 Virtualization
    Esxi users -- using RAW (physical ) disks in VM's: Hi folks those of you who are trying / using Esxi then it;s possible to pass thru (or attach) physical RAW disks to your VM's - so you can attach existing Windows (NTFS) or Linux formatted disks and also RAID configured arrays as RAW disks. For software RAID attach the...
  10. Future of VM's - KVM, Windows and Vmware

    in Windows 10 Virtualization
    Future of VM's - KVM, Windows and Vmware: Hi Folks I thought this is a reasoned (for once) and decently written informative article --not a sales pitch that we so often get from "Pseudo Technical" articles written in such places like PC magazine etc. Anyway enjoy -- you don't have to agree with it but I found...