Windows 10: KVM Virtual Machines -- Host access from the VM

Discus and support KVM Virtual Machines -- Host access from the VM in Windows 10 Virtualization to solve the problem; Hi there Don't do this on a LIVE distro though as these aren't persistent so you won't be able to save changes !!!! A good way of playing with this... Discussion in 'Windows 10 Virtualization' started by jimbo45, Aug 6, 2020.

  1. jimbo45 Win User

    KVM Virtual Machines -- Host access from the VM


    Hi there

    Don't do this on a LIVE distro though as these aren't persistent so you won't be able to save changes !!!!

    A good way of playing with this stuff without touching any Internal HDD's is to install the Linux system on an external HDD (SSD is better) connected via USB3-->SATA to computer -- response time is perfectly good enough even for the VM !!) -- This way it won't mess up any boot records on the HDD.

    For people using KVM/QEMU for creating VM's there's often a problem with the Virtual Machine's being able to access the HOST (the VM's can access Internet and other machines on your LAN OK of course).

    (I assume you've installed KVM/QEMU etc and know how to create a basic Virtual Machine first. - There's loads of info in the internet on how to do that if you aren't sure)

    The usual way around that is to create a Bridge which can be fiddly and currently these often don't work on a lot of Wireless NIC's

    So the easiest way is to create a separated "isolated" network and use 2 Virtual NIC's

    1) create an Isolated network on the Host say in any directory for example /tmp/isolated.xml (XML file) and give it a fixed IP address e.g as shown. (Use any decent text editor to create the XML file - you don't need a special XML editor --Windows Notepad is fine too.)

    In the example I've defined my network with the name isolated and the file is on /tmp.isolated.xml (note to create an empty file in Linux simply use the command touch e.g touch /tmp/isolated.xml - now you can edit it).

    <network>
    <name>isolated</name>
    <ip address="192.168.254.1" netmask="255.255.255.0">
    <dhcp>
    <range start="192.168.254.2" end="192.168.254.254"/>
    </dhcp>
    </ip>
    </network>

    2) Define it to the Host system : sudo virsh net-define /tmp/isolated.xml
    3) Start it : sudo virsh net-start isolated
    4) to start automatically at HOST boot : sudo virsh net-autostart isolated
    you should see console message : Network isolated marked as autostarted
    5) restart the libvirtd service. (sudo systemctl restart libvirtd) -- to automatically start the libvirtd service at HOST boot : sudo systemctl enable libvirtd)
    6)Now for the NICS for the VM in the VM config file -- nic 1 as <nic inteface e.g ethx or empxx or whatever>:macvtap source mode bridge, and the second one as Virtual network <name --in my case isolated> device model virtio -- you can use any hardware for the model - I'm using the paravirtualised stuff for windows VM's on the downloadable winvirtio iso from fedora site -- works with other distros without issue.

    7) start guest -- For guest access to the HOST the address will be fixed at 192.168.254.1 (note that's not the HOST's real IP address which is accessible as normal by rest of your LAN).


    KVM Virtual Machines -- Host access from the VM [​IMG]


    The XML file will look something like this for NIC 2 --depending on your hardware - it's automatically generated after you've defined the basic setup/

    <interface type="network">
    <mac address="52:54:00:b0:3c:94"/>
    <source network="isolated" portid="4afe495d-53a4-49fa-84e1-85d5c658bf78" bridge="virbr0"/>
    <target dev="vnet0"/>
    <model type="virtio"/>
    <alias name="net0"/>
    <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
    </interface>

    Works on Wifi cards as well if you want to mess about with this stuff on a Laptop !!!! - Always backup a Main Windows image though if installing a linux distro on your main Windows machine so you can restore again. Probably the best way to test this is to install the Linux system to external SSD/HDD rather than Dual boot -- remember though to allow enough HDD space for the Windows VM -- the actual Linux distro will sit quite happily with 10 - 20 GB depending on what you install.


    Cheers
    jimbo

    :)
     
    jimbo45, Aug 6, 2020
    #1
  2. jimbo45 Win User

    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 External Switch in HYPER-V). Otherwise the VM will have access to the Internet only and other parts of your LAN but no host access either way -- either from HOST TO VM or from VM to HOST.

    I've assumed you've already installed basic networking and managed to create a Virtual Machine . (You can create the bridge of course before creating the Virtual Machine to test if it's working properly).

    1) On the HOST install bridge-utils
    2) Create the bridge -- this is done with a simple file in /etc/netctl directory -- my example is kvm-bridge
    3) here's the simplest possible file . If you don't like the basic vi editor (ugh !!!!) you can use a wysisyg full screen editor e.g kate that allows root save to root access only folders.

    Interface=br0
    Connection=bridge
    BindsToInterfaces=(enp2s0f1) ===>to a physical device in your system --
    IP=dhcp

    4) start the bridge : netctl start kvm-bridge

    5) automatically start at Host boot

    netctl enable kvm-bridge

    6) Check via any command if interfaces all working (via ifconfig or any appropriate command). To display the bridge use the command brctl show.

    7) In Samba add these two lines to /etc/samba.conf file

    bind interfaces only = yes
    interfaces = br0 >>>>> Name of your bridge

    If you don't do this on the HOST (only) the host will not have any access to any VM's on the LAN whatever host they are attached to -- even those on different physical machines - it will still be able to access physical machines and the Internet though.

    8) in the VM config for windows (Easy GUI is to use lib-virt - Virtual machine manager) create virtual network --- specify network source -- etc as shown (for Virtio install the win-virtio drivers otherwise a physical nic card will come up - can be used also but virtio is streets ahead for better for Windows)


    KVM Virtual Machines -- Host access from the VM [​IMG]


    9) Now your VM has full network access


    KVM Virtual Machines -- Host access from the VM [​IMG]


    10 ) And from the HOST (Hestur) -- the 2nd VM is a VMWare W10 VM on a different host (wulf) not running KVM.


    KVM Virtual Machines -- Host access from the VM [​IMG]


    Job Done "Seeemples" !!!


    enjoy !!!! ( it's a lot more fun than just starting up VMWare player !!!!!)


    Cheers

    jimbo
     
    jimbo45, Aug 6, 2020
    #2
  3. playerdn Win User
    playerdn, Aug 6, 2020
    #3
  4. jimbo45 Win User

    KVM Virtual Machines -- Host access from the VM

    Windows VM V2V (Virt to Virt) conversion KVM to and from VMWare

    Hi there
    The easiest way to achieve converting a Windows VM from (or to) KVM / VMWare is to forget about the VMWare's conversion software -- doesn't really work satisfactorily and takes forever to run is simply to do the following

    a) From KVM to VMWare (or even to a Real machine --then don't install VMWare tools if converting to a real machine).

    1) ensure you have an iso image of Macrium's recovery software .
    2) simply take an image of the windows VM from within the VM via Macrium free or similar.
    3) create a basic VM on Vmware - don't install the OS etc - simply create the virtual hard disk and virtual DVD drive pointing to the iso image of macriums' bootable recovery media.
    4) restore the image
    5) you will certainly then need to "Fix windows boot problems" so boot from the firmware via the VM menu to boot from the iso image.
    6) should be bootable -- now update drivers etc as required and of course install VMWare tools.

    Note if you have vmware player you'll need to add a line each time into the VMWare config file to get the VM to boot into the firmware (i.e setup)

    Another trap for the unwary -- if you want to set the VM as booting via UEFI) and the option is greyed out on VMWare WKS or you are on VMWare player then do it as per my very old post (still valid) here.

    This also shows the addition that VMWare player users can make to get the VM to boot into the firmware (setup) menu -- note also you have to do that each time you want to boot into the firmware when using VMWare player.

    VMWARE create EFI Virtual machine (solved)

    b) from VMWare to KVM


    steps 1) and 2) as above
    3) create your VM via the Virtual machine manager in KVM if using a GUI (can be done with CLI and XML but if you have the GUI use that as it's quite a nice interface and really easy to use). ensure Iso image is added as a CD ROM
    4) restore image
    steps 5) and 6) as above (but you won't need VMWare tools in the VM so no need to install it)

    You'll need to alter the networking for KVM -- to get full network access you will need to set to bridged networking and create a network bridge from a real NIC to the network bridge -- bridge-utils does that. Limitation here is you can't currently do this on a Wireless networking --in that case you'll have to stick with NAT which gives the VM internet access.

    Anyway have fun -- it's much quicker making VM's like this rather than creating from scratch for the different platforms if you want to try out different systems.

    This might also work for Virtual Box (VBOX) too but I haven't installed that. (As the old textbooks used to say "That's left as an exercise for our readers" !!). Could also work for VM's with HYPER-V --I might test the process later.

    Here's result -- Identical Windows 10 (build 331) on VMWare (converted from the KVM one) and QEMU / KVM running on Linux kernel 5.7.7 - You can run KVM Hypervisor and VMWare VM's concurrently BTW).


    KVM Virtual Machines -- Host access from the VM [​IMG]


    The only difference was I renamed the VMWare one so as not to have 2 machines with the same netname on the Lan - the Windows machines end in HUNDUR the NAS machines are the other ones.

    The VMWare machine didn't even want / require re-activation.

    Cheers
    jimbo
     
    jimbo45, Aug 6, 2020
    #4
Thema:

KVM Virtual Machines -- Host access from the VM

Loading...
  1. KVM Virtual Machines -- Host access from the VM - Similar Threads - KVM Virtual Machines

  2. Why can't the virtual machine access the host's network folder

    in Windows 10 Network and Sharing
    Why can't the virtual machine access the host's network folder: Hello,I use hyper-v generation 2 virtual machine.I set two virtual machines and one host machine.Now, this two virtual machines can communicate with each other through Network to shared folders and the host machine can open shared folders through Network. But two Virtual...
  3. 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...
  4. 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...
  5. How activate Windows 10 on KVM Virtual Machine

    in Windows 10 Installation and Upgrade
    How activate Windows 10 on KVM Virtual Machine: Hello, so I have installed Windows 10 legit license successfully on KVM under Linux but cant activate it, error 0x803fa067. Who at MS can help me fix this. thanks...
  6. Enable Windows VM's HOST access with KVM HOSTS

    in Windows 10 Virtualization
    Enable Windows VM's HOST access with KVM HOSTS: Hi folks If you are playing around with KVM Hosts and want Windows VM's to have host access without going through all problems of creating bridges (not supported via KVM on WIFI anyway) here's a simple way to do it : The method works by defining a "Virtual network" and a...
  7. 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...
  8. Virtual KVM?

    in AntiVirus, Firewalls and System Security
    Virtual KVM?: Does anyone know if there is such thing as a virtual KVM with the following simple feartures. 1) Requires hardware (like a KVM) 2) The screens are windows rather than taking up a full monitor. I understand RDP and TeamViewer do these things however they require software...
  9. Get access to VM machine on Hyper-V from login screen of Host PC

    in Windows 10 Customization
    Get access to VM machine on Hyper-V from login screen of Host PC: Hello everyone, I bought W10 pro last week. I've set up some VM's for whom i had some older Windows keys for. My question is, i want to use these VM's as a sort of user. Because my real Local user accounts have important software that i want to keep seperate (like one is a...
  10. KVM Host --W10 VM with HYPER -V running another VM (Nesting)

    in Windows 10 Virtualization
    KVM Host --W10 VM with HYPER -V running another VM (Nesting): Hi there. It seems some CPU's will handle HYPER-V in a VM running on a Host where a HYPERVISOR (KVM in this case) is already running. One needs to make a few mods otherwise booting up the VM running UNDER the HYPER-V (the 2nd level VM) will freeze. I'm currently...