I'm installing ubuntu server 10.04 over kvm switch. I have no physical access to the server. The server has ubuntu installation cd inserted. How to prevent setup from ejecting it after completion?


This is actually documented in the 10.04 Installation Guide.

It's under "Ubuntu Installer Parameters." The relevant paragraphs:


By default, before rebooting, debian-installer automatically ejects the optical media used during the installation. This can be unnecessary if the system does not automatically boot off the CD. In some cases it may even be undesirable, for example if the optical drive cannot reinsert the media itself and the user is not there to do it manually. Many slot loading, slim-line, and caddy style drives cannot reload media automatically.

Set to false to disable automatic ejection, and be aware that you may need to ensure that the system does not automatically boot from the optical drive after the initial installation.

| improve this answer | |
  • it cannot retract automatically (like in notebooks) – Poma Dec 13 '11 at 18:26
  • Ah... So I guess it depends on exactly how the software is ejecting. Is it using the eject command? Maybe temporarily change permissions: 'sudo chmod 0644 /usr/bin/eject' and after the install 'sudo chmod 0755 /usr/bin/eject'? – user8290 Dec 13 '11 at 18:36
  • It's not software, it's installation of linux itself. – Poma Dec 13 '11 at 18:49
  • @Poma Sorry... revised with the right stuff. – user8290 Dec 13 '11 at 18:59
  • 1
    This answer is unsatisfying, because there is NO hint in the documentation WHERE to use this exactly. There are no clues whatsoever. Is it a boot option, when you start from the cdrom/usb stick? Is it later in the text menu and, if yes, where exactly in the menu can I find this option? Sorry, but I voted this down. Simply showing me the part of documentation isn't enough. – s1mmel Aug 31 '15 at 12:14

Why would you want it to not eject ? It will reboot to the CD.

At any rate, you will have to remaster the server CD

See : Ubuntu wiki Live CD Customization

The modification is minor. Following that link, extract the iso.


You need to edit one file /etc/rc0.d/S89casper comment out (add a # in the front) and/or modify the following lines:

# eject -p -m /cdrom >/dev/null 2>&1

# [ "$prompt" ] || return 0
## Add the following line: 
return 0

# XXX - i18n
# MSG="Please remove the disc and close the tray (if any) then press ENTER: "

# Modify 
/sbin/usplash_write "TIMEOUT 86400"

# To read 
/sbin/usplash_write "TIMEOUT 0"

I pulled that syntax from the ubuntu 10.04 desktop CD, there may be some variation with the server CD.

Then make your iso


So it should be extract the iso, edit a single file, wrap your iso. If you need hlep with the syntax, pastebin the relevant section of /etc/rc0.d/S89casper

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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