Ask Your Question

tataprase's profile - activity

2018-05-14 16:30:03 -0500 received badge  Famous Question (source)
2017-12-18 22:40:37 -0500 received badge  Notable Question (source)
2017-12-18 22:40:37 -0500 received badge  Popular Question (source)
2017-05-17 11:49:08 -0500 commented answer startup script to mount share in fedora 25

@formicida I returned to solution with command set in /etc/rc.d/rc.local file, this does the job exactly as it should. Thank you

2017-05-17 11:37:41 -0500 commented answer startup script to mount share in fedora 25

@genodeftest I tried to implement solution you suggested and did not manage to make it work. What I tried so far is to edit /etc/fstab with noauto option to look like this:

vboxshare /path/mountpoint vboxsf rw,user,noauto 0 0

I also tried to append unhide and umask=000 and in outcome, I never managed to get non-privileged user to mount shared virtualbox share after logon. According documentation, user switch in /etc/fstab entry should enable plain user to mount specified share. To mention that i played with ownership of mount point folder set to user and root for test

2017-05-15 16:06:54 -0500 commented answer startup script to mount share in fedora 25

Comparing solutions: with rc.local there is only one entry in use for mounting, fstab and startup script include two entries. However, it does sounds logical to mount with /etc/fstab (noauto) which is intended for that purpose, especially if this can be done without specifying user and later on, any user can mount if needed. Off topic: how do you do that paths red marking? I tried to vote but it says >10 points requred to vote. How do I get 10 points? It says: Use the 30 daily voting points that you get! on the top of the page Thanks, apriciated

2017-05-15 15:57:57 -0500 commented answer startup script to mount share in fedora 25

@vtrefny and others, Thank you, I already implemented /etc/rc.d/rc.local command and it is working fine but am willing to switch to suggested /etc/fstab noauto solution. So, noauto will postpone mounting which can later be done by less privileged user (will set to be automatic). Do I also need to set user option with /etc/fstab to enable specific user?

2017-05-15 15:41:35 -0500 commented answer startup script to mount share in fedora 25

@genodeftest Thank you for advice, I appreciate and will never, ever hit 777 to any directory. However, 777 was shot at rc.local file, not directory (which also is I believe over-permissive). Changed to 755 and now it looks like:

-rwxr-xr-x. 1 root root 72 May 14 11:26 /etc/rc.d/rc.local

Question regarding this: if it was 555, there would be no w for owner and script would be executable for anyone but no one would be able to write/change? Thanks. Newbie in Linux/Fedora world (but like it)

2017-05-14 12:31:54 -0500 received badge  Self-Learner (source)
2017-05-14 12:31:54 -0500 received badge  Teacher (source)
2017-05-14 11:36:35 -0500 answered a question startup script to mount share in fedora 25

@fcomida @sideburns Thanks a lot. This worked.

I did not need to edit sudoers file, placing the code to /etc/rc.d/rc.local did the job. Also it was not necessary to enable rc.local, just creating the file and setting appropriate permissions was sufficient:

touch /etc/rc.d/rc.local
chmod 777 /etc/rc.d/rc.local

@genodeftest Thanks for suggestion. I already tried placing line to /etc/fstab (mentioned in my question) but it did not work. I assumed that might be fstab execution time is before system gets vbox shared drive.

Also, for someone else that might be walking same path, I failed to notice that when running:

sudo mount -t vboxsf share /home/username/Desktop/mount_point/

mounting of share is being completed, but in read-only mode, as it was done by root. That is why option with uid or gid needed to be added, so command that worked for me was:

mount -t vboxsf -o uid=1000 data /home/username/Desktop/Host/

(uid=1000 provided there is only one user on the system, other wise put username)

2017-05-13 15:31:38 -0500 asked a question startup script to mount share in fedora 25

Hello,

I am trying to figure out this for few days, spent hours with google and tried bunch of solutions, so would appreciate any help.


Description: Running Fedora 25 as VirtualBox guest VM, with VBox guest additions installed. In a host machine, within VirtualBox I have shared drive that is visible in guest, and I can mount it in guest Fedora 25 when I trigger command in terminal:


**sudo mount -t vboxsf share /home/username/Desktop/mount_point/**

What I am not able to do is to put this in a script and make automatize the process at startup.

What I tried so far: I use Autostart - System Settings to trigger script at startup and this always fails.

So far I understood that mounting of Vbox shared drive must be done with sudo privileges so my script looks like:


**#!/bin/bash
sudo mount -t vboxsf share /home/username/Desktop/mount_point/**

and fails.

Script file was set as "Is Executable"


Tried autostartup Pre-KDE-startup option.


Script file located in /home/username/Documents/ and later I tried switching to location within root folder,

Changed permissions on the scirpt file to include permissions for current user to rwx and still failing.

I included specific user/group to command like:


**sudo mount -t vboxsf -o uid=username,gid=username data /home/username/Desktop/mount_point/**

and failed

I tried to send password to sudo by adding echo password | before sudo and , do I need to tell, failed.

Also tried editing fstab to include entry to mount share, and this also failed (suppose fstab execution is being done before system get virtualbox shared drive), tried setting script as startup service to run once - no luck.

So, I am out of idea, and would highly appreciate any advice. Thanks in advance.