From owner-freebsd-virtualization@FreeBSD.ORG Tue Aug 27 23:12:11 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 32083622 for ; Tue, 27 Aug 2013 23:12:11 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-lb0-x22e.google.com (mail-lb0-x22e.google.com [IPv6:2a00:1450:4010:c04::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8EA962A5A for ; Tue, 27 Aug 2013 23:12:10 +0000 (UTC) Received: by mail-lb0-f174.google.com with SMTP id w6so3121267lbh.19 for ; Tue, 27 Aug 2013 16:12:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=I4d3f9JRskwcJ9u3xd+Rz/N+pMVNn57l7eVBVg2wIo4=; b=kl7rfpzF1ZedM0jyckO06GWBCeWrYxxsJycJgx95Dmwb8glp6FzbPfmSRmjJzjSTxF AxL/mnVriW7fwreKllZ+W6y8NdK7jUbWkb89MhLQbw8IaVebTMA0+PLMusdfVcWjThDC PMMe/RInrMjVufCDgPTbf4VLHMrDaDFdbO8C1sYriJ6Yy6qV1dpRkVRv3qYDwgRNqeOf VuYWKDhanP7mtUrZ8vaO0O7UP1/0s4cgGSdVLQ7WHpPAKtgtDPNS5QpkPg75l/C+Edsr Dk9Ku+KT1UNCDAdhi2o4z/CzammeUGOaooa2yLsYQYu5jGbnZtn58dE/Tma27fT7tPda ZAog== MIME-Version: 1.0 X-Received: by 10.152.45.106 with SMTP id l10mr21119270lam.12.1377645128232; Tue, 27 Aug 2013 16:12:08 -0700 (PDT) Sender: crodr001@gmail.com Received: by 10.112.168.136 with HTTP; Tue, 27 Aug 2013 16:12:08 -0700 (PDT) Date: Tue, 27 Aug 2013 16:12:08 -0700 X-Google-Sender-Auth: A9OeriYsc7ni0c7Ft4fvLjEQPAg Message-ID: Subject: Simulating CD-ROM device with BHyve and ISO disk image? From: Craig Rodrigues To: "freebsd-virtualization@freebsd.org" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 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: Tue, 27 Aug 2013 23:12:11 -0000 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