# FreeBSD 10.1 Guest KVM post-install boot fails



## strobe33333 (Jan 20, 2015)

Hi All,

Installed FreeBSD 10.1 from release ISO on KVM running on Ubuntu 12.04 in an attempt to create an OpenStack FreeBSD 10.1 image. 
`kvm -m 1024 -cdrom /u01/images/FreeBSD-10.1-RELEASE-amd64-disc1.iso -drive file=/u02/staging/freebsd10.1/freebsd10.1.img,if=virtio -boot d -net nic -net user -nographic -vnc :1`

Installed successfully (or so it indicates).

Immediately after installation I run:
`kvm -m 1024 -drive file=freebsd10.1.img -boot c -net nic -net user -nographic -vnc :1`

It boots, finds the boot loader, attempt to boot from the default loader options and hits:

```
mountroot: waiting for device /dev/vtbd0p2
Mounting from ufs:/dev/vtbd0p2 failed with error 19.

Loader variables:
   vfs.root.mountfrom=ufs:/dev/vtbd0p2
   vfs.root.mountfrom.options=rw
```
Running ? from the mountroot prompt shows:

```
List of GEOM managed disk devices:
  gptid/1d38eec7-a0e3-11e4-9bb5-b13e03555748 gptid/1d382e54-a0e3-11e4-9bb5-b13e03555748 diskid/DISK-QM00001p3 diskid/DISK-QM00001p2 diskid/DISK-QM00001p1 cd0 ada0p3 ada0p2 ada0p1 diskid/DISK-QM00001 ada0
```

When I boot to boot prompt and run `lsdev` I see the proper disks/labels (though they are labelled as disk0p1, disk0p2, etc.) I've tried those as options at mountroot to no avail.

The image file has the right perms and sits at 2.3 GB, indicating that it was indeed installed to.

1. Can someone point me to the definition of error 19?
2. Any KVM gurus out there that can help walk me through troubleshooting?

Thanks.


----------



## strobe33333 (Jan 20, 2015)

More info. 

So I'm thinking that even though the 10.x kernel includes built modules for Virtio, that I might be running into a problem with them being loaded in the new install. So I decided to try and mount my image (created by the KVM install) on an existing FreeBSD box and see what is going on with the boot partition. Here's my exploration.

```
[root@server /home/letme1n]# mdconfig -a -t vnode -u 0 -f freebsd10.1.img

[root@server /home/letme1n]# fdisk /dev/md0

******* Working on device /dev/md0 *******

parameters extracted from in-core disklabel are:

cylinders=473 heads=255 sectors/track=63 (16065 blks/cyl)


parameters to be used for BIOS calculations are:

cylinders=473 heads=255 sectors/track=63 (16065 blks/cyl)



fdisk: invalid fdisk partition table found

Media sector size is 512

Warning: BIOS sector numbering starts with sector 1

Information from DOS bootblock is:

The data for partition 1 is:

sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)

    start 63, size 7598682 (3710 Meg), flag 80 (active)

beg: cyl 0/ head 1/ sector 1;

end: cyl 472/ head 254/ sector 63

The data for partition 2 is:

<UNUSED>

The data for partition 3 is:

<UNUSED>

The data for partition 4 is:

<UNUSED>
```

I'm probably doing this wrong... again your assistance is appreciated.


----------



## gesperon (Feb 2, 2015)

Haven't made an image from a KVM install, but https://raymii.org/s/tutorials/FreeBSD_10.1-release_Openstack_Image.html instructions worked for me.


----------

