So apparently I do not have permissions on my 2nd physical drive in Ubuntu (help)

I have taken up the Gaming on Linux challenge and boy am I in trouble.

I have QEMU+Virt-Manager set up and did some of the pre-stuff (iommu etc. do not know how much of it is working yet).

I have 2 physical drives both SSD, I want to run my VM on my second drive which I have formatted (I formatted it as ext4 Linux internal drive).

I am trying to make my Custom Storage --> Storage Volume and set it to my second SSD, but I keep getting permission errors (no search and later I got no access errors).

How do I set my 2nd drive so that it can be accessed by QEMU?
I have tried “sudo chown -R th:th /media/th/SSD” (my ID is th), but that does nothing. I have also tried “sudo chown -c th:th /media/th/SSD/DIR/win7.qcow2” - the actual volume file, but that did nothing.

Anyone who can point me in the right direction?

NTFS doesn’t support unix file permissions so if the drive is NTFS formatted chown is silently ignored. In that case you can set the permissions right when you mount the drive.

I formatted the 2nd drive as ext4 (Linux internal disk) and still QEMU cannot acces it to make the Custom Storage. I get an error regarding VM not having access to search the drive?!?

I can copy files to the drive and delete them no problem, I have also tried making a folder (in Nautilus) and pointing to that in the Custom Storage in Virt-Manager. And still I get the permissions errors (either the cannot search or another gui-xxxx something something).

Are you trying to pass the entire drive to the VM or are you trying to create a disk image on the drive in linux?

The way I did this was to add my separate drive in the connections menu in Virt Manager (edit -> connection details -> storage) and then set that as default storage for VM’s, that way I didn’t have to create a custom storage option, though I store my VM in a qcow2 image.

Yes the 2nd drive is only going to only hold the VM I am hoping this will remove any lag caused by drive access/load, so I want to pass the entire drive to the VM (drive/folder does it matter?).

Pass the drive to VM, have the VM make the ISO on that drive.

I am not at my computer right now, hopefully I can find that menu you mention (I find that guides often state: “go to this menu and do this bla bla” and when I look at Virt-manager there is no such menu. Hopefully I can find what you propose, thanks!

If you do create a Disk Image rather than passing through the entire disk, I think you might need to check the permissions on the folder/image file. On Ubuntu, when I create disks in the default location they have -rw------- libvert-qemu kvm permissions and owners.

accesserror

I made the ISO, copied it from default to my 2nd drive, changed permissions using “sudo chown -c th:th o.qcow2” which worked like a charm (I am a Linux nab, so pleasently surprised that it worked).

Checked and changed the permissions in Files, so that everyone can read/write.

Still getting the error in the picture :expressionless:

Wow, I just saw that the error is pointing to a completely different directory on the main drive (wtf). Why is there a copy of my 2nd SSD drive under media/th?

Did “sudo chown -c th:th th” and changed permissions.

Linux Desktop Environments will often mount extra storage (CDs, DVDs, USB Drives etc) under /media/<your-username/<name of the device>.

I believe the File Explorer (nautilus) in the second picture is substituting /media/<your-username>/SSD for just ‘SSD’. You could confirm this a few ways:

  • Running df -hT in a terminal which will list mapped drives (and few other things)
  • Using the Disks utility you had open in your second post, selecting the disk/partition and seeing where it is mounted.

It may also be a good idea to change the permissions on the image file to -rw------- libvert-qemu kvm as I mentioned before. You can do this using:
chown libvert-qemu:kvm <image file>
chmod 600 <image file>

So I have a similar set up to what you are going for. ( I’m not at home right with my system so bear with me. )

If I remember right you need to pass through a raw drive in virt manager. At least this is how I did it. It also wouldn’t allow me to add an already formatted (ntfs) drive. It would want to format it and “Build a Pool”

could you give me more details please?

I go into the Connectio Details menu, I can add Pool (lower left corner green arrow), what type do I select?

disk: physical disk device ?
fs: pre-formatted block device?
other?

If I select the physical drive, I have to define destination path (destination of what?) and source path (source of what?) and I can mark “pool” selection box, do I do that?

So I could not get pre formatted block device to work. I used physical disk device.

The source Is /dev And the destination path is going to be /dev/sd* (I might have that backwards… again I’m not at my machine.) Also I know for sure I had to mark the pool selection box. Then after that you should be able to create a partition for the new device. I left it raw and ended up with /dev/sdb/sdb1. Windows VM then could use that.

Also I’m on Ubuntu 18.04. So I had to allow this passthrough in app armor.

Detailed walkthough of that in this guide

Alternatively, you could just use a disk image on the disk.
In this case you define it as a filesystem directory, name it and then simply chose the path to the drive/folder on the drive where you want to store the disk image.

Nothing seems to work, something is always changing I might get a VM up and running, but the next time I start it up I get the disk access errors and the image is locked to root or locked to some VM guest. It is terribly confusing.

Here is how I passed through my physical drive. Hopefully it works for you.

Find your disk using ls -l /dev/disk/by-id/

Example:

ata-KINGSTON_SH103S3120G_50026B652302764F

In virt-manager go into your VM settings… Storage > Select or create custom storage > Paste disk-by-id in the box (Don’t click manage)"

Best of luck :slight_smile: