I am running Windows XP as a guest on Ubuntu 18.04 LTS with qemu/kvm.
I want to use this Windows instance to manage my CCTV IP camera which uses ActiveX applets.
I need this Windows XP to get IP from the same subnetwork as IP camera is.
How can I configure this Virtual Machine using Virtual Machine Manager?
I use a laptop, so my main connection is WiFi (inteface name wlp2s0).
In the /etc/netplan/01-network-manager-all.yaml
I have
# Let NetworkManager manage all devices on this system
network:
version: 2
renderer: NetworkManager
And if I edit the content of my /etc/network/interfaces
I get no connection to the internet (laptop does not bring up the WiFi connection)
I tried this tutorial without any success
Then I tried this one. Here is said "Then add the Ethernet interface as a port in the bridge..." and I noticed that nmcli
command can be passed type
argument. I read help about that argument and I managed to pass wifi ssid MYSSID
arguments to configure that bridge with my WiFi connection.
So I managed to pull these commands:
sudo nmcli conn add type bridge con-name br0 ifname br0
sudo nmcli conn add type wifi ssid MYSSID slave-type bridge con-name bridge-br0 ifname enp1s0 master br0
In the second one I changed ethernet to wifi ssid
sudo nmcli conn show --active
sudo nmcli conn up br0
Then the tutorial says I need to put down the ethernet connection - so I thought that in my case I need to put down wifi connection.
How come this should work? I want my laptop to have a connection and my bridged virtual guest operating system to have one.
When I issue ip a
the br0 connection does not have an IP address from DHCP.
If I bring up WiFi connection no new IP address shows up on the bridge interface (ip a
)
There is a native bridge (virbr0) that is installed with the QEMU/KVM environment. It is used for NAT (Network Address Translation) connections to your local subnet.
This should be sufficient for managing your IP camera. Your XP VM would only need its own IP on the net if other systems will be contacting it.
But in either case you should start with the NAT bridge to keep things simple until you are certain your XP VM is configured correctly. It almost certainly is not!
You can test for the presence of the Virtual Bridge on your host system by:
If it is present, you should be able to select it for use by your XP VM in virt-manager by setting Network source to "Virtual Network 'default':NAT" as shown:
Check your XP for a working network driver. If the following picture is familiar...
you need a driver disk! I recommend Red Hat's virtio driver.
Add a comment if you still want the full bridge. I use networkd/Netplan exclusively in my environment but I could pound out a Network-Manager solution, I think.
You need to create a network bridge on the host PC. This answer is based on the understanding that your IP cameras, Ubuntu host OS and Windows XP VM will all be on the same network (with no advanced VLAN configuration).
sudo apt-get install bridge-utils
Host Static IP Configuration
Note that the lines
auto eth0
andiface eth0 inet manual
are not in the file. This is because br0 will bring up the components assigned to it.bridge_stp off
is a setting for spanning tree. If you have a possibility for network looks, you may want to turn this on.bridge_fd 0
turns off all forwarding delay. If you do not know what this is, you probably do not need it.bridge_maxwait 0
is how long the system will wait for the Ethernet ports to come up. Zero is no wait.Host DHCP Configuration
This will create a virtual interface br0. You can have multiple bridges, and some need not have any actual network card assigned.
sudo /etc/init.d/networking restart
orsudo reboot
.If the host freezes for a few seconds when stopping or starting a guest VM, it is because a Linux bridge is taking the hardware address (MAC address) of the lowest number interface of all connected interfaces. To resolve this, add the line
post-up ip link set br0 address 00:00:00:00:00:00
to the bridge interface configuration, replacing the MAC address with the one of the physical interface connected.Links:
I suggest you try the following. It has worked for me many times, however the host OS was CentOS, not Ubuntu, and the VMs were Linux-based and not Windows-based. However, I don't think the OS will make a big difference here.
Don't do anything special to your
wlp3s0
interface - just leave it as it is configured by default.In
virt-manager
, change the settings of the network card on the virtual machine as shown below (installvirt-manager
if you don't have it).Set "source device" to "wlp3s0 : macvtap" (I hope you should have this choice in the selection menu) and "Source mode" to "Bridge". The virtual machine needs to be shut down and restarted for the setting to take effect.
By doing this you are directly connecting the virtual network card on your VM to the
wlp3s0
device on your host OS. It should see exactly the same network as yourwpl3s0
sees and behave just like another device connected to that network.It works for me, I hope it will work for you too.