Hale's picture

Somehow Automount in fileserver doesn't work, despite it is listed as a feature.

How can I fix it?

I need CD and USB drives to be automounted to SAMBA. The appliance is running under VirtualBox for Windows (x64).

Hale's picture

The strange thing is there is udevd running, but do nothing.

Seems like automount is disabled by default and no manual tells how to enable it back!

People, please, help!


It, actually does't automount VBOX shares the same. FSTAB doesn't work because it is processed too soon to see VBOX shares, UDEV doesn't work.


Eric (tssgery)'s picture

Sorry, but I am missing something.

What, exactly, do you want to do?

  • Insert a cd/image onto the TKL fileserver and have it automatically mount it locally?
  • Mount an existing smb share from another machine (TKL is the client, some other machine is the server with the share)?
Hale's picture


I want CD support. USB flash drives support, if possible (seems it is the same as CD for UDEV)

It is said that CD Automount is supported for Fileserver.

Configured shares: CD-ROM with automount

cdrom share is present by default in preconfigured Samba


It is obvious that I want Automount to function. I.e.:

- create /media/cdrom on CD insert HAL event

- mount /media/cdrom or /media/cdrom/{volume_name} the same time.

- unmount and delete the folder on removal HAL event.


There is everything needed in the TKL, but configuration is broken. I can't figure out how to fix UDEV configs to mount CDROM and USB drives.

Eric (tssgery)'s picture

automount is also used to automatically mount shares from remote servers, so I was just trying to confirm what you wanted to do.

Thank you for that.

I tried it on an older version of TKL fileserver (all that I have available at the moment) and saw the same behaviour (the CD not autmounting). I also noticed that the autofs package was not installed on my system, which might be a clue as to why it's not working. 

If you find the solution, please post back as I am sure it will help others.

Hale's picture

do you have experience with udev? it seems, it should be enough to automount CDs...it works well on archlinux and a couple of others. but something is wrong there, in TKL.

Jeremy Davis's picture

Although unfortunately I don't recall the exact steps. I got all the info on how to do it via google though...

I'm not sure about it being mentioned as a feature anywhere because as far as I know TKL doesn't have automount configured by default (and rightly so IMO) but it should be pretty straight forward...

If you keep in mind that the current TKL v12.x is based on Debian 6/Squeeze, a google such as "automount cd samba debian squeeze" serves up a number of results that look like they'd be useful. I think you'll also need to investigate 

Bottom line is that it seems to me that you are having a few separate issues. Whilst they are sort of interrelated, addressing them one at a time is the way to go IMO.

Hale's picture

please see previous comment.

It is not just TKL, but a Fileserver appliance with /media present and CDROM share created by default.

udev is running by default, but some hot head blocked the support for automount.

Jeremy Davis's picture

I thought you were complaining about USB not automounting (which AFAIK is not configured in any TKL appliances...)

I haven't ever tested that feature so I won't deny that it's a possibly a bug, but I doubt very much that it was caused by "some hot head". Assuming that you are using the v12.1 release (which only just came out) then perhaps it is a regression?

The other thing that springs to mind is the question of whether you have VBox tools installed? TBH I don't know if that's a requirement but I'd be inclined to install them and see if it helps. Also have you made sure that you have the CDROM passing through correctly to the VM? Can you mount it ok manually?

Hale's picture

"The other thing that springs to mind is the question of whether you have VBox tools installed?"

I have. Do you think the've damaged udev?

Actually, I mount the host's NTFS volume through VBOX to use it with SAMBA. It is just easier to manage contents this way.


I tried to pass CDROM and to mount images.

My experience tells that it should generate the same insertion events in Ubuntu and Windows guests.

Yes, I can mount CD's manually from /dev/sr0 and /dev/sda1.

Jeremy Davis's picture

But TBH I have no idea... I have never run TKL servers on hardware nor used automount with the Fileserver so I have no idea whether this behaviour is limited to running inside VBox or whether it is just totally broken (regardless of where it is running...) 

I vaguely recall needing to install VBox tools to get host shares auto mounting at boot...

I do know that to automount USBs you need to install AutoFS (or similar - as suggested above by Eric). Seeing as you also have stated that you desire USB automounting (and auto sharing) then perhaps it's worth installing now anyway and see if that also helps with CD automount? I'm not sure on the best practice for auto-sharing USBs though...

Hale's picture

that startup mount doesn't work either (I don't know why people call it auto, because it is not automatic)...the fstab is processed earlier than tools module. so I mount it in the startup script.

Jeremy Davis's picture

If so then that definately did work (I had it working fine with v12.0 on a VBox (forget which version) install I did some time ago... I wrote this tutorial as I did it... Although IIRC there is a step missing towards the end as by default only root has access when mounted with fstab).

If VBox auto mount of shared folders at boot (shared on your host via VBox) isn't working then either you have made some mistake or there is a regression somewhere (perhaps in TKL v12.1 or the version of VBox itself or the version of Vbox tools you've used...).

Hale's picture

Sorry, I didn't understand the Idea you are talking about...

I have:


uname -r 2.6.32-5-686

VirtualBox 4.2.12 build r84980

host: win7 x64

vbox tools installed according to the VBOX help (updates and dkms are according manual)


both, VBOX shares and CD can be mounted manually via mount.

VBOX can't be mounted during boot. According to google this is a common problem caused by late process of tools/share. I mount it as a last directive in the boot script.

CD doesn't automount, i.e. automatically upon disk insertion.

/etc/udev/rules.d  .rules for CD (concearning sr0 and sda1 devices) are not processed uppon disk insertion

udevadm monitor doesn't produce any output to console uppon disk insertion.

Hale's picture

tried this script, doesn't work.

devices to mount are correct, /dev/sr0 = /dev/sda1

But nothing happens when inserting disk.

It's like udev is permanently disabled, or all events are filtered out, I don't know...


KERNEL!="sr[0-9]*", GOTO="disc_by_label_auto_mount_end"

# Get label
ACTION=="add", PROGRAM=="/sbin/blkid -o value -s LABEL %E{device}", ENV{dir_name}="%c"

ACTION=="add", RUN+="/bin/mkdir -p '/media/%E{dir_name}'", RUN+="/bin/mount -t auto -o %E{mount_options} /dev/%k '/media/%E{dir_name}'"
ACTION=="remove", RUN+="/bin/umount -l '/media/%E{dir_name}'", RUN+="/bin/rmdir '/media/%E{dir_name}'"


Jeremy Davis's picture

Out of interest, is acpi-support installed?

Jeremy Davis's picture

So yes a package called 'acpi-support'. TBH I don't know a lot about it, but acording to what I have read it supports "a range of hardware events" and I thought perhaps telling the OS that a CD has been inserted may be one of those hardware events... IDK but it may be worth a shot...!?

Also FWIW you do need it installed (or at least 'acpi-support-base') to get a VBox VM to shutdown cleanly.

Hale's picture

... does it mean udev is broken in TKL?

Can fixing it be set as a goal of the future releases?

Jeremy Davis's picture

And I'm not going to speculate on what it imay be (I don't know enough).... But I have lodged an issue (bug report) on the TKL Dev Tracker (https://github.com/turnkeylinux/tracker/issues/43)

Hale's picture

Are there any changes in TKL 13 ?

Add new comment