Unable to access KVM host after setting guest network to passthrough


pig

I know this is risky. I also don't think the reversal will be so difficult. I used virt-manager(remote, using X forwarding) to change the KVM guest's NIC from bridgemode to mode passthrough. Now the host has no network connection. I don't have a GUI on the host, so I can't use it virt-manager. How can I undo my changes without a GUI?

I did virsh edit ubuntu20.04and changed the word passthroughto bridgebut that didn't work. What else can I do?

the output of virsh dumpxml ubuntu20.04:

<domain type='kvm' id='1'>
  <name>ubuntu20.04</name>
  <uuid>b18f80e9-66bf-452c-808a-a8e5a1d8cc30</uuid>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://ubuntu.com/ubuntu/20.04"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory unit='KiB'>12582912</memory>
  <currentMemory unit='KiB'>12582912</currentMemory>
  <vcpu placement='static'>8</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-q35-4.2'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <vmport state='off'/>
  </features>
  <cpu mode='custom' match='exact' check='full'>
    <model fallback='forbid'>EPYC-Rome</model>
    <vendor>AMD</vendor>
    <feature policy='require' name='x2apic'/>
    <feature policy='require' name='tsc-deadline'/>
    <feature policy='require' name='hypervisor'/>
    <feature policy='require' name='tsc_adjust'/>
    <feature policy='require' name='arch-capabilities'/>
    <feature policy='require' name='xsaves'/>
    <feature policy='require' name='cmp_legacy'/>
    <feature policy='require' name='virt-ssbd'/>
    <feature policy='require' name='rdctl-no'/>
    <feature policy='require' name='skip-l1dfl-vmentry'/>
    <feature policy='require' name='mds-no'/>
    <feature policy='require' name='pschange-mc-no'/>
    <feature policy='disable' name='clwb'/>
    <feature policy='disable' name='umip'/>
    <feature policy='disable' name='rdpid'/>
    <feature policy='disable' name='wbnoinvd'/>
    <feature policy='disable' name='amd-stibp'/>
    <feature policy='require' name='topoext'/>
  </cpu>
  <clock offset='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/home/liquidadmin/VirtualBox VMs/solomon4/solomon4.qcow2' index='1'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <alias name='usb'/>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <alias name='usb'/>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <alias name='usb'/>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x2'/>
    </controller>
    <controller type='sata' index='0'>
      <alias name='ide'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'>
      <alias name='pcie.0'/>
    </controller>
    <controller type='pci' index='1' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='1' port='0x10'/>
      <alias name='pci.1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/>
    </controller>
    <controller type='pci' index='2' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='2' port='0x11'/>
      <alias name='pci.2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/>
    </controller>
    <controller type='pci' index='3' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='3' port='0x12'/>
      <alias name='pci.3'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/>
    </controller>
    <controller type='pci' index='4' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='4' port='0x13'/>
      <alias name='pci.4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/>
    </controller>
    <controller type='pci' index='5' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='5' port='0x14'/>
      <alias name='pci.5'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x4'/>
    </controller>
    <controller type='pci' index='6' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='6' port='0x15'/>
      <alias name='pci.6'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x5'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
    </controller>
    <interface type='direct'>
      <mac address='52:54:00:af:74:d3'/>
      <source dev='enp3s0' mode='bridge'/>
      <target dev='macvtap0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/0'/>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/0'>
      <source path='/dev/pts/0'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-1-ubuntu20.04/org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0' state='disconnected'/>
      <alias name='channel1'/>
      <address type='virtio-serial' controller='0' bus='0' port='2'/>
    </channel>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='mouse' bus='ps2'>
      <alias name='input1'/>
    </input>
    <input type='keyboard' bus='ps2'>
      <alias name='input2'/>
    </input>
    <graphics type='spice' port='5900' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
      <image compression='off'/>
    </graphics>
    <sound model='ich9'>
      <alias name='sound0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1b' function='0x0'/>
    </sound>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
    </video>
    <redirdev bus='usb' type='spicevmc'>
      <alias name='redir0'/>
      <address type='usb' bus='0' port='2'/>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
      <alias name='redir1'/>
      <address type='usb' bus='0' port='3'/>
    </redirdev>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
    </memballoon>
    <rng model='virtio'>
      <backend model='random'>/dev/urandom</backend>
      <alias name='rng0'/>
      <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
    </rng>
  </devices>
  <seclabel type='dynamic' model='apparmor' relabel='yes'>
    <label>libvirt-b18f80e9-66bf-452c-808a-a8e5a1d8cc30</label>
    <imagelabel>libvirt-b18f80e9-66bf-452c-808a-a8e5a1d8cc30</imagelabel>
  </seclabel>
  <seclabel type='dynamic' model='dac' relabel='yes'>
    <label>+64055:+108</label>
    <imagelabel>+64055:+108</imagelabel>
  </seclabel>
</domain>
NK_

If your previous configuration was bridging of the host ethernet interface, I believe changing the following <interface>section will correct the situation. Just don't forget to change "bridgename" with your own bridge name:

    <interface type='bridge'>
      <mac address='52:54:00:af:74:d3'/>
      <source bridge='bridgename'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>

If it doesn't work, I suggest you create a new VM with the bridge configuration as before. Run the "virsh dumpxml" command for that VM and use the <interface>part for the VM in question. Remember to use the original mac of 52:54:00:af:74:d3

Please let me know if these work.

Related


Unable to resume KVM guest after rebooting host

Japanese and Chinese I'm running KVM on Linux Mint 17.1, kernel 3.16.0-31-generic. The only guest is a Windows 8.1 VM. I noticed that if the host is restarted while the guest is running, the guest cannot be recovered after the host restarts. Virt-manager just

Unable to resume KVM guest after rebooting host

Japanese and Chinese I'm running KVM on Linux Mint 17.1, kernel 3.16.0-31-generic. The only guest is a Windows 8.1 VM. I noticed that if the host is restarted while the guest is running, the guest cannot be recovered after the host restarts. Virt-manager just

KVM guest access host USB serial dongle

Sardathrion - Preventing SE Abuse I have a KVM virtual machine running CentOS 7 on a host running Fedora 24. I installed a USB serial dongle (actually an RFID reader, but that should be fine) on that host. The host can see it after running: sudo modprobe usbse

KVM guest access host USB serial dongle

Sardathrion - Preventing SE Abuse I have a KVM virtual machine running CentOS 7 on a host running Fedora 24. I installed a USB serial dongle (actually an RFID reader, but that should be fine) on that host. The host can see it after running: sudo modprobe usbse

KVM: iPhone Passthrough Windows Guest

Jonas I'm using KVM on an ubuntu 15.04 guest, as well as Windows 7 and Windows 10 guests. I have my iPhone connected to my PC and want to redirect it (using virt-manager) to the guest. I always get errors. spice-client-error-quark: Failed to redirect Apple Inc

KVM: iPhone Passthrough Windows Guest

Jonas I'm using KVM on an ubuntu 15.04 guest, as well as Windows 7 and Windows 10 guests. I have my iPhone connected to my PC and want to redirect it (using virt-manager) to the guest. I always get errors. spice-client-error-quark: Failed to redirect Apple Inc

KVM: VPN host, guest needs VPN and host access to NFS

diagonal I'm running an Ubuntu guest in KVM, which in turn runs on an Ubuntu host. The host network goes through a VPN (OpenVPN), providing tun0. I need the guest network to go through the VPN as well, except I need to be able to access the host over the netwo

KVM: VPN host, guest needs VPN and host access to NFS

diagonal I'm running an Ubuntu guest in KVM, which in turn runs on an Ubuntu host. The host network goes through a VPN (OpenVPN), providing tun0. I need the guest network to go through the VPN as well, except I need to be able to access the host over the netwo

Setup Network on Virtualbox Guest to Access Host VPN

nixgadget I'm trying to get this setup going, but I'm having a lot of trouble. Host OS: Windows 8 64bit Guest OS: CentOS 6.5 64-bit I use the Cisco VPN client on the host to connect to many remote servers that I want to access from the Guest OS. Currently I ha

Setup Network on Virtualbox Guest to Access Host VPN

nixgadget I'm trying to get this setup going, but I'm having a lot of trouble. Host OS: Windows 8 64bit Guest OS: CentOS 6.5 64-bit I use the Cisco VPN client on the host to connect to many remote servers that I want to access from the Guest OS. Currently I ha

kvm guest network issue

Order I have a server running kvm that has been upgraded from ubuntu 13.10 to 14.04 and since the upgrade takes hours (less in some cases) client machines (mix of linux and windows, using both virtio, realtek and intel as the network interface)), network probl

kvm guest network issue

Order I have a server running kvm that has been upgraded from ubuntu 13.10 to 14.04 and since the upgrade takes hours (less in some cases) client machines (mix of linux and windows, using both virtio, realtek and intel as the network interface)), network probl

Unable to ping or access guest from host - vmware

crowd I have win7 OS with vmware workstation with debian 7. This is the IP configuration of the host (win 7) Connection-specific DNS Suffix . : IPv4 Address. . . . . . . . . . . : 10.47.235.94 Subnet Mask . . . . . . . . . . . : 255.255.255.255 De

Unable to ping or access guest from host - vmware

crowd I have win7 OS with vmware workstation with debian 7. This is the IP configuration of the host (win 7) Connection-specific DNS Suffix . : IPv4 Address. . . . . . . . . . . : 10.47.235.94 Subnet Mask . . . . . . . . . . . : 255.255.255.255 De

Unable to ping or access guest from host - vmware

crowd I have win7 OS with vmware workstation with debian 7. This is the IP configuration of the host (win 7) Connection-specific DNS Suffix . : IPv4 Address. . . . . . . . . . . : 10.47.235.94 Subnet Mask . . . . . . . . . . . : 255.255.255.255 De

Unable to ping or access guest from host - vmware

crowd I have win7 OS with vmware workstation with debian 7. This is the IP configuration of the host (win 7) Connection-specific DNS Suffix . : IPv4 Address. . . . . . . . . . . : 10.47.235.94 Subnet Mask . . . . . . . . . . . : 255.255.255.255 De

Control KVM guest Linux OS using Java without network access

User 1050755 I know there are kvm -stdio A kvm guest can be accessed without setting up a network. But this is slow and can be cumbersome. Is there a better solution? I want to run commands and transfer data. The main problem is that I don't want to run anyth

KVM host, add LV to guest

Bafast I have a KVM host with a software RAID 10 array. A software RAID 10 array is a PV on the host, with only one VG. I'm using several LVs ( data storage for KVM guest .imgfiles ) at the host level. Typically, when adding a new disk to the guest, I create a

Host CPU temperature in KVM guest

Yun-Chih Chen I am trying to use to lm_sensorsdetect host CPU temperature in a KVM guest. In the host, after inserting the x86_pkg_temp_thermal kernel module, the sysfs interface /sys/class/thermal/thermal_zone*/tempwill display the required information. Here

KVM host, add LV to guest

Bafast I have a KVM host with a software RAID 10 array. A software RAID 10 array is a PV on the host, with only one VG. I'm using several LVs ( data storage for KVM guest .imgfiles ) at the host level. Typically, when adding a new disk to the guest, I create a

Host CPU temperature in KVM guest

Yun-Chih Chen I am trying to use to lm_sensorsdetect host CPU temperature in a KVM guest. In the host, after inserting the x86_pkg_temp_thermal kernel module, the sysfs interface /sys/class/thermal/thermal_zone*/tempwill display the required information. Here

Access VirtualBox Mac OS guest on Windows 10 host network

Shahzad Latif | I have a Windows 10 host with an IP address of 192.168.8.101, a subnet mask of 255.255.255.0 and a gateway of 192.168.8.1. I also have Mac OS Sierra installed on VirtualBox on this Windows host. This guest macOS has an IP like 10.0.2.15 and a g

Access VirtualBox Mac OS guest on Windows 10 host network

Shahzad Latif | I have a Windows 10 host with an IP address of 192.168.8.101, a subnet mask of 255.255.255.0 and a gateway of 192.168.8.1. I also have Mac OS Sierra installed on VirtualBox on this Windows host. This guest macOS has an IP like 10.0.2.15 and a g

Access VirtualBox Mac OS guest on Windows 10 host network

Shahzad Latif | I have a Windows 10 host with an IP address of 192.168.8.101, a subnet mask of 255.255.255.0 and a gateway of 192.168.8.1. I also have Mac OS Sierra installed on VirtualBox on this Windows host. This guest macOS has an IP like 10.0.2.15 and a g

Access internet host from qemu guest via bridged network

Robert Munteanu I am trying to setup multiple qemu tasks on the same private network. I want them not to be accessible outside the host, but they should be able to reach each other and get resources from the internet. For context, this will be an important kub