1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
permissions: 0.902
PID: 0.894
debug: 0.890
other: 0.888
socket: 0.875
performance: 0.872
device: 0.845
KVM: 0.842
graphic: 0.824
semantic: 0.823
network: 0.820
boot: 0.785
files: 0.785
vnc: 0.583
kvm hangs at 100% cpu when connecting to forwarded ports (when listed incorrectly on the command line)
Binary package hint: qemu-kvm
If kvm is started using two separate "-net user,hostfwd=<forwarding rule>" arguments to forward ports from the host to the client, it won't complain, but will return a connection refused error and hang at 100% cpu when trying to connect to either forwarded port.
However, if kvm is started with the hostfwd rules combined together into a single "-net user" argument, it works fine.
As an example, this command line doesn't generate any warnings or errors, but causes kvm to hang for me:
kvm -net nic -net user,hostfwd=tcp:127.0.0.1:8888-:80 -net user,hostfwd=tcp:127.0.0.1:2222-:22 -m 128 -smp 1 -drive file=disk0.qcow2
... but this command line works fine:
kvm -net nic -net user,hostfwd=tcp:127.0.0.1:8888-:80,hostfwd=tcp:127.0.0.1:2222-:22 -m 128 -smp 1 -drive file=disk0.qcow2
ProblemType: Bug
Architecture: amd64
Date: Fri Oct 16 17:19:59 2009
DistroRelease: Ubuntu 9.10
KvmCmdLine: Error: command ['ps', '-C', 'kvm', '-F'] failed with exit code 1: UID PID PPID C SZ RSS PSR STIME TTY TIME CMD
MachineType: Sony Corporation VGN-SZ650N
NonfreeKernelModules: nvidia
Package: kvm (not installed)
PccardctlIdent:
Socket 0:
no product info available
PccardctlStatus:
Socket 0:
no card
ProcCmdLine: root=UUID=3ee4953e-48f0-497c-ae78-18cbb18cfef8 ro quiet splash
ProcEnviron:
LANGUAGE=en_US.UTF-8
PATH=(custom, user)
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-14.47-generic
SourcePackage: qemu-kvm
Uname: Linux 2.6.31-14-generic x86_64
dmi.bios.date: 07/12/2007
dmi.bios.vendor: Phoenix Technologies LTD
dmi.bios.version: R0081S5
dmi.board.asset.tag: N/A
dmi.board.name: VAIO
dmi.board.vendor: Sony Corporation
dmi.board.version: N/A
dmi.chassis.type: 10
dmi.chassis.vendor: Sony Corporation
dmi.chassis.version: N/A
dmi.modalias: dmi:bvnPhoenixTechnologiesLTD:bvrR0081S5:bd07/12/2007:svnSonyCorporation:pnVGN-SZ650N:pvrJ002VXGP:rvnSonyCorporation:rnVAIO:rvrN/A:cvnSonyCorporation:ct10:cvrN/A:
dmi.product.name: VGN-SZ650N
dmi.product.version: J002VXGP
dmi.sys.vendor: Sony Corporation
On Lucid alpha 3 an error is reported and kvm stops:
$ sudo kvm -net nic -net user,hostfwd=tcp:127.0.0.1:8888-:80 -net user,hostfwd=tcp:127.0.0.1:2222-:22 -m 128 -smp 1 -drive file=disk0.qcow2kvm -net nic -net user,hostfwd=tcp:127.0.0.1:8888-:80 -net user,hostfwd=tcp:127.0.0.1:2222-:22 -m 128 -smp 1 -drive file=lucid.qcow2
could not set up host forwarding rule 'tcp:127.0.0.1:8888-:80'
qemu-kvm Version: 0.12.3-0ubuntu2
Torsten-
Check your command line. Looks like you double-pasted the faulty command.
Jesse-
I can actually confirm this in Lucid's qemu-kvm 0.12.3. I ran your exact two lines and it seems to lock my kvm process and eat a bunch of cpu.
The symptoms look very similar to Bug #474968.
Anthony, can we have a look at this?
At the very least, the manpage needs to be updated, as the "hostfwd=[tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport" section says: "This option can be given multiple times."
The documentation aspect of this bug should be fix along with Bug #474969.
This bug was fixed in the package qemu-kvm - 0.12.3-0ubuntu6
---------------
qemu-kvm (0.12.3-0ubuntu6) lucid; urgency=low
[ Dustin Kirkland ]
* debian/postinst: clean up jaunty-era conffiles on upgrade, LP: #455411
* debian/links, debian/qemu-kvm-extras.links: install non-x86 arch
manpages in the qemu-kvm-extras package, LP: #478552
[ Brian Thomason ]
* debian/patches/better_describe_-net_options.patch: improve port
forwarding documentation, LP: #474969, LP: #453617
-- Dustin Kirkland <email address hidden> Fri, 05 Mar 2010 18:39:19 -0600
Is there still an issue left here with upstream QEMU?
There hasn't been any comment about upstream QEMU within the last months, so I assume this has been fixed there, too. Closing...
|