# Bhyve Virtual Disk Pointed At Full Physical Disk?



## CoryG (Apr 26, 2017)

Is it possible to create a bhyve virtual disk which is pointed at an actual physical disk which already has an operating system installed on it?  In my case I have 4 drives, one for FreeBSD and 3 from my old Windows installation, I would like to use bhyve to do PCI passthrough for a graphics card on demand while keeping the ability to dual-boot back into Windows if desired at some point (plus not wanting to reinstall and configure everything.  I've gotten this working without PCI passthrough using virtualbox, but unfortunately that doesn't cut it for UE4 or gaming in general so I'm looking at bhyve as an option.


----------



## CoryG (Apr 27, 2017)

If it helps, I'm currently attempting:


```
sudo bhyve -c 1 -m 8G -H -w -s 0,hostbridge -s 4,virtio-blk,/dev/ada1s2 -s 5,virtio-blk,/dev/ada2s1 -s 6,virtio-blk,/dev/ada3p2 -s 7,virtio-net,tap0 -s 29,fbuf,tcp=0.0.0.0:5900,wait -s 30,xhci,tablet -s 31,lpc -l com1,stdio -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd win7
```

But run into the following:


```
Boot Failed. EFI Misc Device
Boot Failed. EFI Misc Device 1
Boot Failed. EFI Misc Device 2
```

The first device (ada1s2) should be a bootable drive, and it works from virtualbox so the device seems correct.


----------



## grehan@ (Apr 27, 2017)

Was this 32-bit Win7 ? If so that's not yet supported by bhyve.

If it is 64-bit, do you know if Win7 was installed on BIOS (and not UEFI) ? Does `gpart` say that any of the drivers are GPT-partitioned ?


----------



## aragats (Apr 27, 2017)

CoryG said:


> sudo bhyve -c 1 -m 8G -H -w -s 0,hostbridge -s 4,virtio-blk,/dev/ada1s2 -s 5,virtio-blk,/dev/ada2s1 -s 6,virtio-blk,/dev/ada3p2 -s 7,virtio-net,tap0 -s 29,fbuf,tcp=0.0.0.0:5900,wait -s 30,xhci,tablet -s 31,lpc -l com1,stdio -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd win7


I believe, with physical disks you should use:
	
	



```
... -s 5,[b]ahci-hd[/b],/dev/ada2s1,sectorsize=512 ...
```
(sectorsize=512 ensures that Windows 7 will understand such disk)


----------



## Ordoban (Apr 27, 2017)

```
... /dev/ada1s2 ...
```

Does ada1s2 contains a partition table? I don't think so. My guess is UEFI needs the partition table to boot. Try 
	
	



```
... /dev/ada1 ...
```


----------

