Hi there
@
cereberus
install package swtpm on your distro -- you don't need to start any daemons / configure it -- the VM should do it all for you.
There's a version in git-hub as well if there isn't a package for your distro. I think ubuntu has a package so shouldn't be any problem.
then in the vm (install virtmanager for the GUI) simply specify :
In the VM you should see the TPM as the IBM emulator. Run command tpm.msc in the guest.
if you are doing everything from the command line then edit the VM's xml config file
add this :
<tpm model="tpm-crb">
<backend type="emulator" version="2.0"/>
<alias name="tpm0"/>
</tpm>
(of course the emulator has to be installed first on the HOST !!).
Note also you will need the VM to at least have UEFI boot (preferably sec boot too). For this to be enabled install package ovmf on your distro. Then when setting up the GUEST ensure sec boot is available.
Depending on your hardware networking might work better with emulated e1000e NICs rather than virtio.
Also for HOST / GUEST communication you need to do the following : (OK it's a little bit if a pain but :)
1) create an Isolated network on the Host say in /tmp/isolated.xml (XML file) -- give it a fixed IP address e.g as shown.
<network>
<name>isolated</name>
<ip address="192.168.254.1" netmask="255.255.255.0"> ===== Your VM will use this addr 192.168.254.1 for accessing the Host
<dhcp>
<range start="192.168.254.2" end="192.168.254.254"/>
</dhcp>
</ip>
</network>
2) define it via virsh net-define
root@hestur hrafn]# virsh net-define /tmp/isolated.xml you should see response : Network isolated defined from /tmp/isolated.xml
3)auto start it and also start it (virsh-net start)
[root@hestur hrafn]# virsh net-autostart isolated response from console should be : Network isolated marked as autostarted
4) in the Virtual Machines configuration :
a) Ist Nic define as Host device <nic interface e'g ethx or empxx or whatever>:macvtap device
b) add in the VM a second NIC defined as Virtual network <name --in my case isolated> device model virtio
5) start guest
6) Host will be accessible always as 192.168.254.1
Works fine for Windows VM's on Arch and Fedora. Should also work if the real NIC is a wifi card too. Should also work on any other Linux distro that supports KVM/QEMU Virtual Machines e.g OPENSUSE / LINUX MINT / UBUNTU/DEBIAN.
The XML generated file will look something like this for NIC 2 --depending on your hardware --this is generated automatically if everything is setup correctly.
<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>
If you've done it correctly you should see as the output on the host of ifconfig (or equivalent command these days probably ip -c a) the network virbr1 at the bottom of the screenshot with IP address 192.168.254.1 which is what the Windows VM will use to access the Host. (Note the VM can access other machines on Lan / Internet in the normal way - this is only for the VM to get HOST access).
BTW leave the tablet in as well --that gives proper full screen VM - to get out of full screen move mouse to top of screen or hit esc.
I suggest you also enable openssh-server on the GUEST (it's in the add optional features) -- makes it easier accessing Windows files FROM THE HOST. Install on the HOST package ssh if not already installed and enable it at boot (systemctl enable sshd)
Filezilla is also a great GUI transfer program - works both on Windows and Linux --much better than file explorer, You'll probably need SAMBA on the HOST as well and if not already installed by default package ntfs-3g to directly read / write ntfs files.
Have fun
Cheers
jimbo