From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sasha Levin Subject: Re: [PATCH] kvm tools: Boot to host /bin/sh via 9p by default Date: Tue, 09 Aug 2011 23:30:25 +0300 Message-ID: <1312921825.3619.3.camel@lappy> References: <1312904014-3538-1-git-send-email-penberg@kernel.org> <4E41676A.90000@redhat.com> <1312920404.3619.1.camel@lappy> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Avi Kivity , kvm@vger.kernel.org, Linus Torvalds , Asias He , Cyrill Gorcunov , Ingo Molnar , Prasad Joshi To: Pekka Enberg Return-path: Received: from mail-wy0-f174.google.com ([74.125.82.174]:40188 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753252Ab1HIUb0 (ORCPT ); Tue, 9 Aug 2011 16:31:26 -0400 Received: by wyg24 with SMTP id 24so259173wyg.19 for ; Tue, 09 Aug 2011 13:31:25 -0700 (PDT) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Tue, 2011-08-09 at 23:15 +0300, Pekka Enberg wrote: > On Tue, Aug 9, 2011 at 11:06 PM, Sasha Levin wrote: > > On Tue, 2011-08-09 at 19:59 +0300, Avi Kivity wrote: > >> On 08/09/2011 06:33 PM, Pekka Enberg wrote: > >> > This patch updates 'kvm run' to boot to host filesystem via 9p '/bin/sh' by > >> > default: > >> > > >> > $ ./kvm run > >> > # kvm run -k ../../arch/x86/boot/bzImage -m 320 -c 2 --name guest-3462 > >> > [ 0.000000] Linux version 3.1.0-rc1+ (penberg@tiger) (gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) ) #7 SMP PREEMPT Tue Aug 9 16:39:20 EEST 2011 > >> > [ 0.000000] Command line: notsc noapic noacpi pci=conf1 reboot=k panic=1 console=ttyS0 earlyprintk=serial init=/bin/sh root=/dev/vda rw root=/dev/root rootflags=rw,trans=virtio,version=9p2000.u rootfstype=9p > >> > > >> > [snip] > >> > > >> > [ 1.803261] VFS: Mounted root (9p filesystem) on device 0:13. > >> > [ 1.805153] devtmpfs: mounted > >> > [ 1.808353] Freeing unused kernel memory: 924k freed > >> > [ 1.810592] Write protecting the kernel read-only data: 12288k > >> > [ 1.816268] Freeing unused kernel memory: 632k freed > >> > [ 1.826030] Freeing unused kernel memory: 1448k freed > >> > sh: cannot set terminal process group (-1): Inappropriate ioctl for device > >> > sh: no job control in this shell > >> > sh-4.1# > >> > > >> > >> Most kernels won't have 9p built-in, so how about building a tiny initrd > >> to load the needed modules? > >> > >> btw, I get > >> > >> # ./kvm run > >> # kvm run -k ../../arch/x86/boot/bzImage -m 1728 -c 24 --name guest-10193 > >> > >> > > > > This is usually the case of missing serial console support in the guest > > kernel. > > > > You can either enable these: > > CONFIG_SERIAL_8250=y > > CONFIG_SERIAL_8250_CONSOLE=y > > > > Switch to virtio console using '--console virtio', or boot into a > > graphical console using '--sdl' or '--vnc'. > > Can we somehow sanely detect that the kernel doesn't support serial > console and switch to virtio console? Probably, will look into it tomorrow. -- Sasha.