On the host
I have a virtual bridge setup, and have two static IPs configured:
The host is Ubuntu 18.04 LTS, and is up-to-date at the time of this post.
For the VMs
VM 1 is set up to listen on
5900. When I
sudo virsh start vm1, it starts up correctly and I can connect to it.
It's libvirt config looks like this:
<graphics type='spice' port='5900' autoport='no' listen='10.0.3.1'> <listen type='address' address='10.0.3.1'/> <image compression='auto_lz'/> </graphics>
VM 2 is set up to listen on
<graphics type='spice' port='5900' autoport='no' listen='10.0.3.2'> <listen type='address' address='10.0.3.2'/> <image compression='auto_lz'/> </graphics>
sudo virsh start vm2 I get an error:
error: Failed to start domain vm2 error: internal error: Failed to reserve port 5900
sudo netstat -nltp shows the following:
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 10.0.3.1:5900 0.0.0.0:* LISTEN 32092/qemu-system-x
What do I need?
I would like to use different IPs for each VM, and use the same 5900 port, but I am getting these errors saying that the port is already bound (which it is, just on a different address).
How can I get it to use the same port but on a different address?