Failed to boot chromiumOS with kvm, error is could not set up host forwarding rule

745 views
Skip to first unread message

Xing

unread,
Mar 6, 2017, 8:37:28 PM3/6/17
to Chromium OS dev
Hi, I followed this https://www.chromium.org/chromium-os/how-tos-and-troubleshooting/running-chromeos-image-under-virtual-machines to setup chromiumOS with kvm.
When boot with ./bin/cros_start_vm, it prompts the following errors:

src/scripts$ sudo ./bin/cros_start_vm --image_path=../build/images/amd64-generic/latest/chromiumos_qemu_image.bin
INFO    : QEMU binary: /g1/cros/chroot/usr/bin/qemu-system-x86_64
INFO    : QEMU version: QEMU emulator version 2.6.0, Copyright (c) 2003-2008 Fabrice Bellard
Starting a KVM instance
INFO    : Launching: /g1/cros/chroot/usr/bin/qemu-system-x86_64 -enable-kvm -m 2G -smp 4 -vga cirrus -pidfile /tmp/kvm.2792.pid -chardev pipe,id=control_pipe,path=/tmp/kvm.2792.monitor -serial file:/tmp/kvm.2792.serial -mon chardev=control_pipe -daemonize -net nic,model=virtio -net user,hostfwd=tcp:127.0.0.1:9222-:22 -drive file=../build/images/amd64-generic/latest/chromiumos_qemu_image.bin,index=0,media=disk,cache=unsafe
qemu-system-x86_64: -net user,hostfwd=tcp:127.0.0.1:9222-:22: could not set up host forwarding rule 'tcp:127.0.0.1:9222-:22'
qemu-system-x86_64: -net user,hostfwd=tcp:127.0.0.1:9222-:22: Device 'user' could not be initialized

BTW, I changed the sshd config files as below, and restart service ssh, the errors are the same.
:/etc/ssh$ diff sshd_config_back sshd_config
28c28,29
< PermitRootLogin without-password
---
> #PermitRootLogin without-password
> PermitRootLogin yes
45c46
< PermitEmptyPasswords no
---
> PermitEmptyPasswords yes
68a70
> AllowTcpForwarding yes

Mike Frysinger

unread,
Mar 6, 2017, 8:43:13 PM3/6/17
to Xing, Chromium OS dev
are you already running a VM w/that port forwarded ?

check dmesg to see if there's anything interesting.
-mike

--
--
Chromium OS Developers mailing list: chromiu...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en


Xing

unread,
Mar 6, 2017, 9:06:06 PM3/6/17
to Chromium OS dev, xin...@intel.com
Thanks.

It does have one kvm instance. After stop it, and restart, I didn't see any chromium OS UI appear. Do you have any hints about this?
BTW, I am trying to add format=raw to ./bin/cros_start_vm, but it seems not so straightforward.


src/scripts$ sudo ./bin/cros_start_vm --image_path=../build/images/amd64-generic/latest/chromiumos_qemu_image.bin
HELLLLLLLLLLLLLLLLLLLLL

INFO    : QEMU binary: /g1/cros/chroot/usr/bin/qemu-system-x86_64
INFO    : QEMU version: QEMU emulator version 2.6.0, Copyright (c) 2003-2008 Fabrice Bellard
Starting a KVM instance
INFO    : Launching: /g1/cros/chroot/usr/bin/qemu-system-x86_64 -enable-kvm -m 2G -smp 4 -vga cirrus -pidfile /tmp/kvm.3864.pid -chardev pipe,id=control_pipe,path=/tmp/kvm.3864.monitor -serial file:/tmp/kvm.3864.serial -mon chardev=control_pipe -daemonize -net nic,model=virtio -net user,hostfwd=tcp:127.0.0.1:9222-:22 -drive file=../build/images/amd64-generic/latest/chromiumos_qemu_image.bin,index=0,media=disk,cache=unsafe
WARNING: Image format was not specified for '../build/images/amd64-generic/latest/chromiumos_qemu_image.bin' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
VNC server running on '127.0.0.1;5901'
INFO    : KVM started with pid stored in /tmp/kvm.3864.pid
INFO    : Serial output, if available, can be found here in /tmp/kvm.3864.serial

Mike Frysinger

unread,
Mar 6, 2017, 9:20:49 PM3/6/17
to Xing, Chromium OS dev
do you mean you don't see a graphics window at all ?  or do you mean it comes up, but stays black, and the Chrome bootsplash/login window doesn't show up ?
-mike

Xing

unread,
Mar 6, 2017, 9:27:04 PM3/6/17
to Chromium OS dev, xin...@intel.com
It shows nothing.

Xing

unread,
Mar 6, 2017, 9:27:29 PM3/6/17
to Chromium OS dev, xin...@intel.com
I means don't see a graphics window at all

Mike Frysinger

unread,
Mar 6, 2017, 9:43:38 PM3/6/17
to Xing, Chromium OS dev
don't run it under sudo.  our scripts take care of that.
-mike

Nicolas Norvez

unread,
Mar 7, 2017, 10:49:53 AM3/7/17
to Chromium OS dev, xin...@intel.com
Hi,

You need a VNC client to see the UI.
The log mentions 'VNC server running on '127.0.0.1;5901', can you try to connect your VNC client to 127.0.0.1:5901 ?

Nicolas.

Xing

unread,
Mar 7, 2017, 8:04:49 PM3/7/17
to Chromium OS dev, xin...@intel.com
 Thanks. Something is wrong with my preinstalled VNC viewer, with Remote Desktop Viewer, it works!

Nathan

unread,
Mar 8, 2017, 9:52:14 AM3/8/17
to Chromium OS dev, xin...@intel.com
If you want to run it without having to VNC in, you can install qemu and kvm on your system natively and invoke it manually:

qemu-system-x86_64 -enable-kvm -m 2G -smp 4 -usb -usbdevice mouse -show-cursor

-vga cirrus -net nic,model=virtio -net user,hostfwd=tcp:127.0.0.1:9222-:22 -drive file=chromiumos/src/build/images/amd64-generic/latest/chromiumos_qemu_image.bin,index=0,media=disk,cache=unsafe

This worked the last time I tried it, which was admittedly a few months ago.

Nathan
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages