Run a script automatically when booting a live version of Ubuntu form a USB stick
Solution 1
You can use mkusb
to create a persistent live bootable ubuntu usb. After that, just add your script under Startup Applications
.
It will remember these changes at your next boot.
Solution 2
Here is a good page about LiveCD Customization, which is what you probably want.
When building the new LiveCD, you can treat the startup issue like you would a normal install, and edit your /etc/rc.local
to include the commands you want to run on every boot. Make sure that you don't include sudo
commands, and it has to exit successfully.
Related videos on Youtube
Comments
-
Forivin over 1 year
I have a Ubuntu install USB stick. I never use it to actually install Ubuntu, I always select the live option (no install). Now there are multiple commands that I always have to run once it has completely booted up. I'm looking for a sort of .bashrc file on the USB stick that always gets executed once the system is up and ready. I read a lot about preseed files, but from what I understand, all that stuff only applies if you're actually installing Ubuntu. https://help.ubuntu.com/community/InstallCDCustomization
Any ideas?
-
Robby1212 almost 7 yearsAnother option would be to leave space on your Live disk for installed apps, then install crontab and have it run scripts upon startup.
-
-
Forivin almost 7 yearsThere doesn't seem to be an /etc directory on the USB stick.
-
Grayson Kent almost 7 yearsIf you follow the steps in that link, the
etc
dir will be under theedit/etc
dir of the downloaded iso.