Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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!!!

share|improve this question
1  
Run sudo virt-manager, no need to connect as root. Don't know if virtio works for physical devices... –  izx Jun 1 '12 at 4:22
    
@izx, thanks for your reply! should that make a make a difference even though virt-manager is being run on my desktop and not the server? –  evan Jun 1 '12 at 4:29

1 Answer 1

Although this has been answered, rather than using /dev/sda you should use /dev/disk/by-id/ where you get from

    ls -l /dev/disk/by-id

That way you are covered just in case the disk changes from /dev/sda to /dev/sdb.

share|improve this answer
1  
Currently this is the only answer (that has ever been) posted on this question. There's some information in comments that might help, but as far as I can tell it's far from certain that they will fix the problem. You might consider expanding this to provide a full solution. If parts of your solution have been devised by others you can always cite them and link to them. I doubt izx would mind ..especially as (when I comment now) izx hasn't signed on to the site for over a year. –  Eliah Kagan Jan 10 at 10:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.