gdwatson
June 22nd, 2008, 03:48 AM
I've gotten a Windows XP VM up and running with virt-manager and KVM on Hardy. I want to access it from the host, so I have file sharing and remote desktop turned on, and Windows firewall off, but accessing 192.168.122.1 just doesn't do it. It's the only VM running.
I edited /etc/sysctl.conf as suggested by the libvirt wiki (http://wiki.libvirt.org/page/Networking#NAT_forwarding_.28aka_.22virtual_networ ks.22.29).
I have the default network setup. I want to avoid a manual bridge, if at all possible-- is that the only way to do this?
On the host:
gdwatson@gdwatson-laptop:~$ nmap 192.168.122.0/24
Starting Nmap 4.53 ( http://insecure.org ) at 2008-06-22 00:46 PDT
Interesting ports on 192.168.122.1:
Not shown: 1713 closed ports
PORT STATE SERVICE
53/tcp open domain
Nmap done: 256 IP addresses (1 host up) scanned in 2.629 seconds
gdwatson@gdwatson-laptop:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:1c:23:fe:5c:3a
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:17
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:34065 errors:0 dropped:0 overruns:0 frame:0
TX packets:34065 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:15867467 (15.1 MB) TX bytes:15867467 (15.1 MB)
vnet0 Link encap:Ethernet HWaddr f2:3b:06:f3:04:71
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
inet6 addr: fe80::f03b:6ff:fef3:471/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:3102 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:135510 (132.3 KB)
wlan0 Link encap:Ethernet HWaddr 00:1c:bf:91:0c:55
inet addr:192.168.55.103 Bcast:192.168.55.255 Mask:255.255.255.0
inet6 addr: fe80::21c:bfff:fe91:c55/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5955 errors:0 dropped:0 overruns:0 frame:0
TX packets:4922 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4220749 (4.0 MB) TX bytes:806883 (787.9 KB)
wmaster0 Link encap:UNSPEC HWaddr 00-1C-BF-91-0C-55-00-00-00-00-00-00-00-00-00-00
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
gdwatson@gdwatson-laptop:~$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.55.0 * 255.255.255.0 U 0 0 0 wlan0
192.168.122.0 * 255.255.255.0 U 0 0 0 vnet0
link-local * 255.255.0.0 U 1000 0 0 wlan0
default 192.168.55.1 0.0.0.0 UG 0 0 0 wlan0
gdwatson@gdwatson-laptop:~$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT udp -- anywhere anywhere udp dpt:bootps
ACCEPT tcp -- anywhere anywhere tcp dpt:bootps
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere 192.168.122.0/24 state RELATED,ESTABLISHED
ACCEPT all -- 192.168.122.0/24 anywhere
ACCEPT all -- anywhere anywhere
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
gdwatson@gdwatson-laptop:~$
And now that I've posted all that it'll be something obvious. ;)
I edited /etc/sysctl.conf as suggested by the libvirt wiki (http://wiki.libvirt.org/page/Networking#NAT_forwarding_.28aka_.22virtual_networ ks.22.29).
I have the default network setup. I want to avoid a manual bridge, if at all possible-- is that the only way to do this?
On the host:
gdwatson@gdwatson-laptop:~$ nmap 192.168.122.0/24
Starting Nmap 4.53 ( http://insecure.org ) at 2008-06-22 00:46 PDT
Interesting ports on 192.168.122.1:
Not shown: 1713 closed ports
PORT STATE SERVICE
53/tcp open domain
Nmap done: 256 IP addresses (1 host up) scanned in 2.629 seconds
gdwatson@gdwatson-laptop:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:1c:23:fe:5c:3a
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:17
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:34065 errors:0 dropped:0 overruns:0 frame:0
TX packets:34065 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:15867467 (15.1 MB) TX bytes:15867467 (15.1 MB)
vnet0 Link encap:Ethernet HWaddr f2:3b:06:f3:04:71
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
inet6 addr: fe80::f03b:6ff:fef3:471/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:3102 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:135510 (132.3 KB)
wlan0 Link encap:Ethernet HWaddr 00:1c:bf:91:0c:55
inet addr:192.168.55.103 Bcast:192.168.55.255 Mask:255.255.255.0
inet6 addr: fe80::21c:bfff:fe91:c55/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5955 errors:0 dropped:0 overruns:0 frame:0
TX packets:4922 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4220749 (4.0 MB) TX bytes:806883 (787.9 KB)
wmaster0 Link encap:UNSPEC HWaddr 00-1C-BF-91-0C-55-00-00-00-00-00-00-00-00-00-00
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
gdwatson@gdwatson-laptop:~$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.55.0 * 255.255.255.0 U 0 0 0 wlan0
192.168.122.0 * 255.255.255.0 U 0 0 0 vnet0
link-local * 255.255.0.0 U 1000 0 0 wlan0
default 192.168.55.1 0.0.0.0 UG 0 0 0 wlan0
gdwatson@gdwatson-laptop:~$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT udp -- anywhere anywhere udp dpt:bootps
ACCEPT tcp -- anywhere anywhere tcp dpt:bootps
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere 192.168.122.0/24 state RELATED,ESTABLISHED
ACCEPT all -- 192.168.122.0/24 anywhere
ACCEPT all -- anywhere anywhere
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
gdwatson@gdwatson-laptop:~$
And now that I've posted all that it'll be something obvious. ;)