How do you automount /dev/xvdi in AppVMs?

232 views
Skip to first unread message

qber...@gmail.com

unread,
Dec 9, 2017, 2:57:08 AM12/9/17
to qubes-users
How do you automount /dev/xvdi in AppVMs?

In a typical OS, this is done by modifying /etc/fstab. With Qubes OS AppVMs, /etc/fstab is not preserved between reboots.

Should I modify the TemplateVM's /etc/fstab?

Should I add "mount /dev/xvdi /mnt/removable" to the AppVM's /rw/config/rc.local?

Unman

unread,
Dec 9, 2017, 10:47:19 AM12/9/17
to qber...@gmail.com, qubes-users
Yes, you can run the mount from rc.local.
Obviously you'll need to ensure that the device is attached first, so
if you're using the qrexec service I suggested, make sure that's called
first and completes before you attempt the mount.

Just for completeness, I'll point out that you can use bind-dirs to make
any file persistent within a qube - have a look at
www.qubes-os.org/doc/bind-dirs/
I'm not sure how this would work with /etc/fstab - I cant check the
service order at the moment - but it's something you might not be aware
of. At worst you'd need an extra 'mount -a' call after bind-dirs.

unman

qber...@gmail.com

unread,
Dec 9, 2017, 12:22:02 PM12/9/17
to qubes-users
On Saturday, December 9, 2017 at 8:47:19 AM UTC-7, Unman wrote:
> Yes, you can run the mount from rc.local.
> Obviously you'll need to ensure that the device is attached first, so
> if you're using the qrexec service I suggested, make sure that's called
> first and completes before you attempt the mount.

Unfortunately, running the mount from rc.local doesn't seem to work (nothing gets mounted and I don't know why).

I'm using a persistent attach for an AppVM.

After adding "sudo mount /dev/xvdi /mnt/removable" to /rw/config/rc.local, I shut down the AppVM, and then start Terminal. After the AppVM starts up, I see that the mount didn't happen.

Any tips on diagnosing this? I didn't see the word "mount" in journalctl. Not sure where else to look or what to look for.

> Just for completeness, I'll point out that you can use bind-dirs to make
> any file persistent within a qube - have a look at
> www.qubes-os.org/doc/bind-dirs/
> I'm not sure how this would work with /etc/fstab - I cant check the
> service order at the moment - but it's something you might not be aware
> of. At worst you'd need an extra 'mount -a' call after bind-dirs.

This is an interesting idea. I didn't know you could persist custom things. I guess the worry here is if /etc/fstab is an autogenerated file.

Personally, I'd like to keep things simple and get the rc.local mount working, but I'll keep bind-dirs in mind for other things.

qber...@gmail.com

unread,
Dec 9, 2017, 12:25:58 PM12/9/17
to qubes-users
On Saturday, December 9, 2017 at 10:22:02 AM UTC-7, qber...@gmail.com wrote:
> Unfortunately, running the mount from rc.local doesn't seem to work (nothing gets mounted and I don't know why).
>
> I'm using a persistent attach for an AppVM.
>
> After adding "sudo mount /dev/xvdi /mnt/removable" to /rw/config/rc.local, I shut down the AppVM, and then start Terminal. After the AppVM starts up, I see that the mount didn't happen.
>
> Any tips on diagnosing this? I didn't see the word "mount" in journalctl. Not sure where else to look or what to look for.

User error! I forgot to make /rw/config/rc.local executable...

The mount in rc.local works now.

Unman

unread,
Dec 9, 2017, 12:47:41 PM12/9/17
to qber...@gmail.com, qubes-users
Did you remember to 'chmod +x' the rc.local file?
I am assuming that you are able to manually mount the device

Also, I should check which Qubes version you are using.

Unman

unread,
Dec 9, 2017, 12:49:07 PM12/9/17
to qber...@gmail.com, qubes-users
Crossed with my last mail.
Glad you got it sorted.
Reply all
Reply to author
Forward
0 new messages