From owner-freebsd-virtualization@FreeBSD.ORG Wed Aug 28 04:08:24 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 942FD36D; Wed, 28 Aug 2013 04:08:24 +0000 (UTC) (envelope-from andrnils@gmail.com) Received: from mail-oa0-x22f.google.com (mail-oa0-x22f.google.com [IPv6:2607:f8b0:4003:c02::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 516E8277F; Wed, 28 Aug 2013 04:08:24 +0000 (UTC) Received: by mail-oa0-f47.google.com with SMTP id g12so6939535oah.6 for ; Tue, 27 Aug 2013 21:08:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=VAYkhYn8D+sVzx1weVw+E4YnTUGM+8LlnZAzMQbEYCg=; b=vEoyggIRfGhY66H4Ds9+crQnCrdVAXsMD8SesTJQZC7zHNp++XLXVredhKgA0D1Z6C Zo2rxacHuQqXBzKXg8lBnUYnKeWmNIUIdstFTnabvoiWFLKiBku4mHtZuCw08QgdBWDn uHajgrySXjPsyfYr6yFC4nbD/pvJD3oC/Y7uR0wPbUXnJ/pN4YfK+Smf6a1Q6LyUlGKI Fatgy2EMSlYzsA2lc4IHDDbRtO1ZkQ9cFBJE4hSLTxP7SrEvZAqlCwoPYVcPgpFud66i yQOe9IhMYxT3wTBppgAguEabgh7pEKXPDzxkmTTE/RHt6SoX/a1ni4YyVbU+j7nSCGZw q7DA== MIME-Version: 1.0 X-Received: by 10.182.72.137 with SMTP id d9mr4860084obv.99.1377662903633; Tue, 27 Aug 2013 21:08:23 -0700 (PDT) Received: by 10.76.144.196 with HTTP; Tue, 27 Aug 2013 21:08:23 -0700 (PDT) In-Reply-To: References: Date: Wed, 28 Aug 2013 06:08:23 +0200 Message-ID: Subject: Re: Simulating CD-ROM device with BHyve and ISO disk image? From: Andreas Nilsson To: Craig Rodrigues Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "freebsd-virtualization@freebsd.org" X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Aug 2013 04:08:24 -0000 What happens if you specify cd9660:iso9660/CDROM when first boot attempt has failed? You could also try cd9660:/dev/vtbd1 Best regards Andreas On Wed, Aug 28, 2013 at 1:12 AM, Craig Rodrigues wrote: > Hi, > > I have an ISO image that I am trying to boot in BHyve. > > I tried this: > > truncate -s 2G /tmp/disk.img > sh /usr/share/examples/bhyve/vmrun.sh -I test.iso -d /tmp/disk.img freenas1 > > The initial kernel boots, but then fails to mount the root device: > > > ============================================================================ > mountroot> ? > > List of GEOM managed disk devices: > iso9660/CDROM vtbd1 vtbd0 > > FreeBSD is a registered trademark of The FreeBSD Foundation. > FreeBSD 9.1-STABLE #0 r+42f8bbd: Sun Aug 18 00:03:25 PDT 2013 > root@build.ixsystems.com: > /tank/home/rodrigc/freenas/freenas/os-base/amd64/tank/home/rodrigc/freenas/freenas/FreeBSD/src/sys/FREENAS.amd64 > amd64 > gcc version 4.2.1 20070831 patched [FreeBSD] > CPU: Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz (2494.19-MHz K8-class CPU) > Origin = "GenuineIntel" Id = 0x206a7 Family = 0x6 Model = 0x2a > Stepping = 7 > > > Features=0x8f8bab7f > > > Features2=0x83ba6257 > AMD Features=0x20100800 > AMD Features2=0x1 > TSC: P-state invariant > real memory = 536870912 (512 MB) > avail memory = 492359680 (469 MB) > Event timer "LAPIC" quality 400 > ACPI APIC Table: > FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs > FreeBSD/SMP: 2 package(s) x 1 core(s) > cpu0 (BSP): APIC ID: 0 > cpu1 (AP): APIC ID: 1 > WARNING: VIMAGE (virtualized network stack) is a highly experimental > feature. > ACPI Warning: FADT (revision 5) is longer than ACPI 2.0 version, truncating > length 268 to 244 (20110527/tbfadt-320) > ioapic0: Changing APIC ID to 2 > ioapic0 irqs 0-16 on motherboard > kbd0 at kbdmux0 > aesni0: on motherboard > cryptosoft0: on motherboard > acpi0: on motherboard > atrtc0: port 0x70-0x71,0x72-0x77 irq 8 on acpi0 > Event timer "RTC" frequency 32768 Hz quality 0 > Timecounter "ACPI-safe" frequency 3579545 Hz quality 850 > acpi_timer0: <32-bit timer at 3.579545MHz> port 0x408-0x40b on acpi0 > pcib0: port 0xcf8-0xcff on acpi0 > pci0: on pcib0 > pcib0: no PRT entry for 0.31.INTA > virtio_pci0: port 0x2000-0x201f mem > 0xc0000000-0xc0001fff at device 1.0 on pci0 > vtnet0: on virtio_pci0 > virtio_pci0: host features: 0x1018020 > > virtio_pci0: negotiated features: 0x1018020 > > vtnet0: Ethernet address: 00:a0:98:30:99:23 > virtio_pci1: port 0x2040-0x207f mem > 0xc0002000-0xc0003fff at device 2.0 on pci0 > vtblk0: on virtio_pci1 > virtio_pci1: host features: 0x10000004 > virtio_pci1: negotiated features: 0x10000004 > vtblk0: 2048MB (4194304 512 byte sectors) > virtio_pci2: port 0x2080-0x20bf mem > 0xc0004000-0xc0005fff at device 3.0 on pci0 > vtblk1: on virtio_pci2 > virtio_pci2: host features: 0x10000004 > virtio_pci2: negotiated features: 0x10000004 > vtblk1: 254MB (521624 512 byte sectors) > uart2: <16550 or compatible> port 0x3f8-0x3ff irq 4 at device 31.0 on pci0 > uart2: console (9600,n,8,1) > Timecounters tick every 1.000 msec > ipfw2 (+ipv6) initialized, divert enabled, nat enabled, default to accept, > logging disabled > DUMMYNET 0xfffffe0002106940 with IPv6 initialized (100409) > load_dn_sched dn_sched WF2Q+ loaded > load_dn_sched dn_sched FIFO loaded > load_dn_sched dn_sched PRIO loaded > load_dn_sched dn_sched QFQ loaded > load_dn_sched dn_sched RR loaded > SMP: AP CPU #1 Launched! > Timecounter "TSC-low" frequency 1247092718 Hz quality 1000 > Trying to mount root from cd9660:/dev/cd0 [ro]... > mountroot: waiting for device /dev/cd0 ... > Mounting from cd9660:/dev/cd0 failed with error 19. > Trying to mount root from cd9660:/dev/acd0 [ro]... > mountroot: waiting for device /dev/acd0 ... > Mounting from cd9660:/dev/acd0 failed with error 19. > > Loader variables: > > Manual root filesystem specification: > : [options] > Mount using filesystem > and with the specified (optional) option list. > > eg. ufs:/dev/da0s1a > zfs:tank > cd9660:/dev/acd0 ro > (which is equivalent to: mount -t cd9660 -o ro /dev/acd0 /) > > ? List valid disk boot devices > . Yield 1 second (for background tasks) > Abort manual input > > mountroot> ? > > List of GEOM managed disk devices: > iso9660/CDROM vtbd1 vtbd0 > > > ============================================================================ > > Currently the logic for how the root mount device is chosen > is hardcoded in the vfs_mountroot_conf0 function: > > http://bxr.su/FreeBSD/sys/kern/vfs_mountroot.c#823 > > > This logic basically says, try in this order: > > cd9660:/dev/cd0 > cd9660:/dev/acd0 > device specified in vfs.root.mountfrom > > It looks like with BHyve, if I invoke the vmrun.sh script as I have > done, the ISO file is not on cd0 or acd0, but is on vtbd1. > > Is there a way I can mount the ISO file on a simulated cd0 device? > This would make the logic in my installer still work. > This ISO image successfully boots on real hardware, > and in qemu with the "-cdrom" flag. > > Thanks. > > -- > Craig > _______________________________________________ > freebsd-virtualization@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization > To unsubscribe, send any mail to " > freebsd-virtualization-unsubscribe@freebsd.org" >