LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   qemu-kvm permission for partition disk (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/qemu-kvm-permission-for-partition-disk-4175531592/)

lupe 01-20-2015 04:57 AM

qemu-kvm permission for partition disk
 
I'd like to use a qemu-kvm image of Slackware Linux OS, so that user data (/home) is read/written directly from a disk partition.

The command I built is (simplified):
Code:

qemu-kvm -enable-kvm -hda slack1.qcow2 -hdb slack_swap.qcow2 -drive file=/dev/sda,media=disk,index=3
But there's an error message:
Code:

could not open disk image /dev/sda: Permission denied
There are two workarounds that I could use:
- issue the qemu-kvm command as root
- add my user to the disk group

The second option seems less insecure than the first option.
Is there any other way of doing this?

In motherboards with VT-d, can this problem be solved differently?

veerain 01-20-2015 05:22 AM

Just make you the owner of sda block device. Udev rules script can be adjusted to just make your user as owner of it.


All times are GMT -5. The time now is 08:11 PM.