I want when the computer start, a byobu session is started and a command executed in the first window (windows 0), without requiring any user intervention.

It is very important that this doesn't require an actual user to login.

How to do that?

I suppose this byobu will be accessible later to user root (or if possible another user ?)

2 Answers 2


If you want a command to be executed at boot time, you can put it in your crontab with @reboot instead of a time. So run crontab and add a line like

@reboot byobu -S boot-time mycommand

Instead of putting the command on the command line of byobu, you can put it in a Byobu session file.

If you want the session to be executed as root, you can start it from /etc/rc.local instead of root's crontab. Be sure to start it in the background, since the boot isn't complete until /etc/rc.local has finished running.

byobu -S boot-time mycommand &

Now byobu is based on tmux, the easiest way is to directly use tmux.

in my case I use the following syntax:

tmux new -d -s session-name /path/to/my/Script.sh

and connect to it I use:

tmux session has -t-name

in your crontab you will have to enter:

@reboot tmux new -d -s session-name /path/to/my/Script.sh

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.