Hi!
I'm trying to figure out how to make automount do its job when nobody is logged at the console and the user access the server by VNC. Does anybody knows how to make CentOS automount USB Hard Drives / Pendrive when accessed by VNC?
Thanks!
Guy Boisvert, ing IngTegration inc.
On Fri, Mar 27, 2009 at 6:35 AM, Guy Boisvert boisvert.guy@videotron.ca wrote:
Hi!
I'm trying to figure out how to make automount do its job when nobody is logged at the console and the user access the server by VNC. Does anybody knows how to make CentOS automount USB Hard Drives / Pendrive when accessed by VNC?
Could you describe the problem a little more clearly? Separation of console from USB-accessible hardware, how VNC fits in in this scenario, etc.
It sounds like someone wants to log in remotely (VNC), plug in a (local) USB device and access it (remotely), which doesn't make sense to me.
Thanks.
mhr
MHR wrote:
On Fri, Mar 27, 2009 at 6:35 AM, Guy Boisvert boisvert.guy@videotron.ca wrote:
Hi!
I'm trying to figure out how to make automount do its job when nobody
is logged at the console and the user access the server by VNC. Does anybody knows how to make CentOS automount USB Hard Drives / Pendrive when accessed by VNC?
Could you describe the problem a little more clearly? Separation of console from USB-accessible hardware, how VNC fits in in this scenario, etc.
It sounds like someone wants to log in remotely (VNC), plug in a (local) USB device and access it (remotely), which doesn't make sense to me.
Thanks.
mhr _______________________________________________
Hi,
It make senses if you're running a box headless (it will be headless soon, now i'm testing it with K+V+M attached). We're using a CentOS box to plug USB Flash drive & external hard drive into it. The CentOS box is then used to FTP the content of these external drives to a Winblows box, all that filtered by a firewall between the 2 boxes. Only FTP is allowed.
Doing some tests on the CentOS box, i saw that if i log into the console, then the local session and the remote VNC sessions will see the drives automounted. If i log out of the console, then the VNC session won't see anything. It's like the automount works only if somebody is logged at the console.
Hope i was clearer. Thanks!
Guy Boisvert, ing. IngTegration inc.
Guy Boisvert wrote:
MHR wrote:
On Fri, Mar 27, 2009 at 6:35 AM, Guy Boisvert boisvert.guy@videotron.ca wrote:
Hi!
I'm trying to figure out how to make automount do its job when nobody
is logged at the console and the user access the server by VNC. Does anybody knows how to make CentOS automount USB Hard Drives / Pendrive when accessed by VNC?
Could you describe the problem a little more clearly? Separation of console from USB-accessible hardware, how VNC fits in in this scenario, etc.
It sounds like someone wants to log in remotely (VNC), plug in a (local) USB device and access it (remotely), which doesn't make sense to me.
Thanks.
mhr _______________________________________________
Hi,
It make senses if you're running a box headless (it will be headless soon, now i'm testing it with K+V+M attached). We're using a CentOS box to plug USB Flash drive & external hard drive into it. The CentOS box is then used to FTP the content of these external drives to a Winblows box, all that filtered by a firewall between the 2 boxes. Only FTP is allowed.
Doing some tests on the CentOS box, i saw that if i log into the console, then the local session and the remote VNC sessions will see the drives automounted. If i log out of the console, then the VNC session won't see anything. It's like the automount works only if somebody is logged at the console.
I assume that with "console" you mean X11/desktop manager. In this case Gnome or KDE handle the mounting of removable devices for you. The automounter hasn't anything to do with it.
If you want the automounter to handle removable devices, then you'll have to add appropriate automounter map entries. Something like
/etc/auto.master: /media /etc/auto.media
/etc/auto.media: usb :/dev/sda1
or you could use a program map like the following (not my invention, I took this from the autofs mailing list):
----- #!/bin/sh if ntfs-3g.probe /dev/sda1; then echo "-fstype=ntfs-3g,other-opts :/dev/sda1" else echo "-fstype=vfat,other-opts :/dev/sda1" fi -----
You'll probably find other examples on the net.
I'm not sure if such an automounter setup collides with Gnome/KDE automounting.
Cheers
frank
On Fri, Mar 27, 2009 at 4:12 PM, Frank Thommen frank.thommen@embl-heidelberg.de wrote:
I assume that with "console" you mean X11/desktop manager. In this case Gnome or KDE handle the mounting of removable devices for you. The automounter hasn't anything to do with it.
Consequently the other option is to change the VNC configuration so that you're running the Gnome or KDE desktop manager in VNC. The tricky bit then is to get it to log out properly as if you were really on the console.
I put the following in $HOME/.vnc/xstartup to accomplish that on CentOS 5:
---- 8< ---- snip ---- #!/bin/sh
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey vncconfig -iconic & gnome-terminal --geometry=80x24+10+10 --title="$VNCDESKTOP Desktop" & ( gnome-session ; kill `cat $HOME/.vnc/${VNCDESKTOP% *}.pid` ) & ---- 8< ---- snip ----
This runs gnome-session in the background, then kills the desktop when the session ends. Replace gnome with KDE to taste.
The "recommended" way to run the desktop ...
# Uncomment the following two lines for normal desktop: # unset SESSION_MANAGER # exec /etc/X11/xinit/xinitrc
... has the undesirable side-effect of leaving the VNC server running with no session or window manager and no X clients when you exit from the session. This is annoying unless you also configure the server to exit on the last client disconnect. I prefer having the server disconnect the clients when the session ends, instead.
(I'd be happy to learn there's a more convenient way to accomplish that.)
Frank Thommen wrote:
Guy Boisvert wrote:
Hi,
It make senses if you're running a box headless (it will be headless soon, now i'm testing it with K+V+M attached). We're using a CentOS box to plug USB Flash drive & external hard drive into it. The CentOS box is then used to FTP the content of these external drives to a Winblows box, all that filtered by a firewall between the 2 boxes. Only FTP is allowed.
Doing some tests on the CentOS box, i saw that if i log into the console, then the local session and the remote VNC sessions will see the drives automounted. If i log out of the console, then the VNC session won't see anything. It's like the automount works only if somebody is logged at the console.
I assume that with "console" you mean X11/desktop manager. In this case Gnome or KDE handle the mounting of removable devices for you. The automounter hasn't anything to do with it.
Yes, X11/DM, logged locally on the "physical" console. Thanks for the hint on automount.
If you want the automounter to handle removable devices, then you'll have to add appropriate automounter map entries. Something like
/etc/auto.master: /media /etc/auto.media
/etc/auto.media: usb :/dev/sda1
or you could use a program map like the following (not my invention, I took this from the autofs mailing list):
#!/bin/sh if ntfs-3g.probe /dev/sda1; then echo "-fstype=ntfs-3g,other-opts :/dev/sda1" else echo "-fstype=vfat,other-opts :/dev/sda1" fi
You'll probably find other examples on the net.
I'm not sure if such an automounter setup collides with Gnome/KDE automounting.
Cheers
frank
Thanks for your help Frank.
The problem i have is that it won't necessarily be the same devices plugged to this box and the user could even plug many devices at the same time.
So i read many articles on the net but i'm kinda lost about where to start for this problem.
Anyway, i'm still reading an thanks again for your help!
Guy Boisvert, ing. IngTegration inc.