Page MenuHomePhabricator

VB not automounting shares (remove shared-folder from 14)
Closed, ResolvedPublic

Description

I have a share that works when I manually run

sudo mount -t vboxsf -o uid=1000,gid=1000 shared /mnt/shared

But it never connects on boot. I have to run the command.

mnt-shared-vbox status is good. Is there something inside its service file (uh, where is it?) that I should look at?

Details

Impact
High

Event Timeline

Patrick triaged this task as Normal priority.Jul 6 2017, 2:20 PM
Patrick changed Impact from Needs Triage to High.
JasonJAyalaP added a comment.EditedJul 7 2017, 7:59 PM

the journalctl command just says "starting" and "started", but looking at the log doing bootup, I found out that the folder is being successfully automounted to /media/sf_shared

In fact, all shares set up to automount inside VBox (whatever the name) are being successfully mounted at boot to /media/sf_$sharename

Was VB not mounting before? Do we no longer need the service?

JasonJAyalaP (Jason J. Ayala P.):

JasonJAyalaP added a comment.

Was VB not mounting before?

In Whonix 13 / Debian jessie based Whonix the mount command was not
automatic.

Do we no longer need the service?

If it works without the service, then we no longer need it. I would
appreciate that.

Something in debian 9 is allowing VB to automatically mount shares (marked as automount) at /media/

Good news for us.

I masked mnt-shared-vbox (I couldnt purge the shared folder package because basic packages depend on it). Everything is mounting in /media/sf_$vb_mount_name

Suggestions:

  1. Remove shared-folder as dependency of other packages
  2. Remove shared-folder from whonix 14
  3. Update the wiki instructions for whonix 14
  4. Add /media to pinned places in dolphin (is this possible)?
  5. Add /media to desktop icons

Suggestions:

  1. Remove shared-folder as dependency of other packages
  2. Remove shared-folder from whonix 14

It's still required for KVM @HulaHoop?

In that case only remove the VirtualBox shared-folder-help systemd unit file.

  1. Update the wiki instructions for whonix 14

Yes. (With a note that it apply to Whonix 14 only because Whonix 14 release will take a while.)

  1. Add /media to pinned places in dolphin (is this possible)?

Certainly possible, but not easy, if we don't know how. -> separate ticket for Whonix 15.

  1. Add /media to desktop icons

Sounds cool. If not easy -> separate ticket for Whonix 15.

JasonJAyalaP (Jason J. Ayala P.):

In fact, all shares set up to automount inside VBox are being successfully mounted at boot to /media/ (named "shared" or not).

This is great news indeed.

JasonJAyalaP renamed this task from VB not automounting shares to VB not automounting shares (remove shared-folder from 14).Jul 11 2017, 7:24 PM

AFAICT VBox can do the auto-mounting because its guest additions DKMS module enables it. I am not aware of Libvirt/KVM doing anything similar so its best to stick with the service.

JasonJAyalaP added a comment.EditedAug 30 2017, 7:53 PM

Then it's a matter of removing the virtual box service file from shared-folder-help, correct?

Can I simply delete?
https://github.com/Whonix/shared-folder-help/blob/master/lib/systemd/system/mnt-shared-vbox.service

Then remove the adduser stuff from .postinst (but keep mkdir mnt/shared because kvm needs it)
https://github.com/Whonix/shared-folder-help/blob/master/debian/shared-folder-help.postinst#L30

And fix the readme (which doesn't even mention kvm right now).

JasonJAyalaP (Jason J. Ayala P.):

JasonJAyalaP added a comment.

Then it's a matter of removing the virtual box service file from
shared-folder-help, correct?

Can I simply delete
https://github.com/Whonix/shared-folder-help/blob/master/lib/systemd/system/mnt-shared-vbox.service

Yes.

Then remove the adduser stuff from .postinst (but keep mkdir

mnt/shared because kvm needs it)
https://github.com/Whonix/shared-folder-help/blob/master/debian/shared-folder-help.postinst#L30

Yes... The following can probably be removed...

addgroup vboxsf || true
addgroup user vboxsf || true

Please test in a new build if it still works out of the box.

And fix the readme (which doesn't even mention kvm right now).

Yes. Fix debian/control instead since readme gets autogenerated.

Notes:

Adding /media to places and desktop.
https://phabricator.whonix.org/T705
https://phabricator.whonix.org/T706

I might be able to add them both to shared folder helper in 14

JasonJAyalaP added a comment.EditedSep 10 2017, 2:55 AM
Please test in a new build if it still works out of the box.
addgroup user vboxsf || true

Without the user being added to the group, my WS image gives a permission denied error. I have to do addgroup user vboxsf. I didn't have to create the group.

(1) Is virtualbox additions creating the group but not adding the user? (and can that be changed to add the user too?
(2) Or just leave the above line (both lines so that it's clearer?) in?

JasonJAyalaP (Jason J. Ayala P.):

JasonJAyalaP added a comment.

addgroup user vboxsf || true

Without the user being added to the group, my WS image gives a
permission denied error. I have to do addgroup user vboxsf. I didn't
have to create the group.

(1) Is virtualbox additions creating the group but not adding the
user? (and can that be changed to add the user too?

Quite likely. The virtualbox guest additions most likely won't do
addgroup user vboxsf, in other words most likely won't add group
vboxs to user user. Usually Debian packages as per Debian policy are
not allowed to do that.

If "add group vboxs to user user" is sti9ll required, we'd still do
that in Whonix has a convenience/usability feature. Debian won't pick
that up.

(2) Or just leave
the above line (both lines so that it's clearer?) in?

Normally I would say, remove redundant code and add comments if
explanation is needed. But this time you need to keep it.

Two things here.
Create group
Add group

Add group depends on create group. But group creation is not guaranteed
since then shared-folder-help would have to depend on
virtualbox-guest-additions, which it doesn't, because it's not only a
virtualbox specific package.

Also then it would depend on the order of packages being installed.
(guest additions followed by shared-folder-help would work but not vice
versa.)

Unless I miss something, probably best add a comment and keep.

Patrick reopened this task as Review.Sep 15 2017, 2:15 PM

Good.

Let's set this to Review which is slightly confusing. I am using this status to imply "test this in the next image build" - and if it's still working, close as resolved. This indeed could use a better phabricator status name, which is somehow possible.

https://secure.phabricator.com/Q40

Patrick changed the task status from Review to testing-in-next-build-required.Sep 15 2017, 2:29 PM