8

Is there a way to get my Ubuntu server (running as a guest in KVM) to use one of the hosts SATA disks? I Want it to have exclusive access and I believe there should be a "native" way. I have googled this for some time but found nothing.

Sorry if there are spelling errors, not my native tongue.

2 Answers2

4

If you are using virt-manager to mange your KVM instances, you can just open it, click on your instance, go to View → Details. There is a button "Add Hardware" were you can add Storage, which may also be a whole hard disk drive. Use 'VirtIO' as a means to access the hard drive - this works well with recent linux kernels, if your guest operating system is linux.

Beware that you do not use the hard disk on the hypervisor as long as the instance is running. E.g. if you mount a filesystem on the hypervisor that resides on the disk and is mounted from within the virtual machine, you are probably going to destroy the filesystem. So, a little extra caution pays well ;-)

ikso
  • 160
  • 1
  • 7
1

The best way to do this in virt-manager, is to add the disk as a storage pool. To do that, rightclick the localhost(QEMU) connection, select "details", "storage" tab, click the "plus" button and follow the wizard to add a new storage pool based on the physical disk (you get a choice there, can actually break the disk into parts with LVM) Then create a volume on that disk, and when you create a VM, attach the pre-created volume

dyasny
  • 18,482
  • 6
  • 48
  • 63