Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

According to Gnome's Desktop Application Autostart Specification, I should be able to have a program execute simply by naming it any of ".autorun", "autorun", or "autorun.sh". None of these seem to work: I get a prompt from nautilus-autorun-software asking if I want to let it run, I say "Run", and it results in a dialog that says "Error autorunning software: Cannot find the autorun program". Is it a bug or am I not doing something correctly?

The autorun file contains the following:

#! /bin/sh
gnome-terminal -x sh -c '~/bin/podcatcher/copypodcasts.sh; echo Done!; read pause'

It works if I manually run the autorun file.

The filesystem is fat, here's the mtab entry:

/dev/sdd1 /media/disk vfat rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush 0 0
share|improve this question
What type of filesystem is on the volume, and what mount options are used? What are the effective permissions on the autorun file? – Gilles Nov 30 '10 at 19:28
@Gilles: details added – Shawn J. Goff Dec 2 '10 at 1:47
I think there should not be a space between #! and /, eg. #!/bin/sh – Martin Jun 30 '11 at 14:12
@Martin It doesn't matter. in-ulm.de/~mascheck/various/shebang/#details – Shawn J. Goff Jun 30 '11 at 18:31

It makes no sense.

An USB drive is automatically mounted and owned by desktop user. But she must umount it and mount it again as root? I can not see a practical use for this behaviour.

Anyway, I tested this root-mount and nothing showed up on the user desktop.

If you take a look on nautilus code 1 the _check_file function has no default for "must_be_executable", and calls to this function do not set that parameter.

The only way I got it working was this:

  • format the USB drive in ext2 or ext3
  • put an autoexec file on it
  • change permissions to make this file executable by a desktop user (file can be owned by anybody)
  • plug the USB drive and let gnome to automount it
share|improve this answer

The cd is probably mounted with the noexec option.

Login as root on a terminal umount it and mount it again as root. This time as a user in the gui autorunning the cd should work. (It does for me with VirtualBox)

share|improve this answer

"Cannot find the autorun program" may mean the file is not executable. If it's a CDROM, the autorun file has to have execute permissions. That requires Rock Ridge extensions to the ISO9660 file system at ISO image creation time.

I'm using the following procedure (NOTE: you'll need lots of disk space).

  1. create a directory containing the files destined for the CDROM including autorun
  2. make sure the files have execute permission. In the directory issue:

    chmod 555 *
  3. create the ISO image using mkisofs or genisoimage (these appear to be the same program).

    genisoimage  -l -R -J -V disclabel -o directory.iso directory
  4. Burn the iso to a blank CDROM using Brasero

  5. This will yield a labeled CDROM with long file names, Joliet and RockRidge extensions.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.