Add physical disk to KVM virtual machine

Posted by evan on Ask Ubuntu See other posts from Ask Ubuntu or by evan
Published on 2012-06-01T04:15:45Z Indexed on 2012/06/01 4:49 UTC
Read the original article Hit count: 518

Filed under:
|

I'm setting up a file server (nas4free) as a KVM virtual machine on a Ubuntu Server 12.04 system.

How do I add physical hard drives directly to the VM so they can be used by the guest (nas4free), but not the host?

Specifically the hard drive I'd like to mount is /dev/sda (which is not currently mounted on the server.)

So far I've found two solutions but I haven't gotten either to work.

The first is from Server Fault where it's suggested to use virt-manager. I haven't gotent this to work because when I try to select an existing drive nothing is being listed. My best guess as to why this is, is because I'm using virt-manager over ssh and not connecting as root, should that make a difference?

The second solution I've found here is to just run the command (modified for my system)

qm set nas4free -virtio /dev/sda

but that seems to require proxmox which I don't have installed and doesn't seem to be in the default repositories?

Finally, once the above is sorted out and I can mount the drive directly to the VM, does anyone have an experience with whether the drive should be mounted to the VM as scsi, ide, or virtio? (I know virtio was recommend in the linked ServerFault page, but I hadn't heard of it before now since I mainly use VMWare).

Thanks for your help!!!

© Ask Ubuntu or respective owner

Related posts about virtualization

Related posts about kvm