oriolrius.cat

Des del 2000 compartiendo sobre…

Tag: byobu

WSL2: upgrade from Ubuntu 18.04 to 20.04

Reading time: 2 – 4 minutes

I was afraid for missing my files, configurations and much other staff that I had in Linux filesystem of WSL2 (Windows 10). But I had to upgrade because of compatibility with an application that I need. So, finally, I decided to upgrade the Ubuntu 18.04 that I installed in WSL2 to a newer version 20.04. Yes, I know that there is 22.04 available nowadays, but I wasn’t comfortable jumping to many versions.

I followed simple steps that I found at:

How To Upgrade Existing WSL/WSL2 Ubuntu 18.04 to 20.04

The steps in a nutshell were:

sudo apt update
sudo apt upgrade -y
sudo apt --purge autoremove
sudo apt install update-manager-core
sudo do-release-upgrade

When I answered all the questions and after stopping the WSL2 VM with:

# command that I ran from 'cmd.exe' (Windows console)
wsl --shutdown 

I had and issue rebooting, WSL2 didn’t boot and it gave this message:

wsl/usr/sbin/enter-systemd-namespace: line 10: /usr/sbin/daemonize: No such file or directory

I resolved the problem, shutting down the WSL and running the command:

wsl -u root -e bash --noprofile --norc

It gave me a root console where I could modify the file:

/usr/sbin/enter-systemd-namespace

specifically, in line 10, I changed:

/usr/sbin/daemonize
to
/usr/bin/daemonize

And when I accessed to WSL2 everything worked perfectly. I used to access WSL2 from Windows Terminal which uses the command:

C:\WINDOWS\system32\wsl.exe -d Ubuntu-18.04

But it has small issues with bybou, finally I changed this command to:

C:\WINDOWS\system32\bash.exe ~ -login

I love to use a console with byobu enabled when access the shell, but with my former command, the command ‘byobu-enable’ was ignored. I didn’t find why, in the end the solution was to change the command that I use for accessing Linux console (WSL2).

Likewise, I hope these notes can help someone.

Nested byobu, re-assigning shortcuts

Reading time: 2 – 2 minutes

I’m a byobu user for a long time, I love it for many reasons. But this is just a quick tip for extreme users like me. I mean people who use byobu for local consoles with remote byobu sessions running on top of SSH, for instance.

When prefix key combinations has to be sent to the remote host we have to press “Control + a + a” and finally the command that we want to send to the remote systems. This is not comfortable many times. So, I modified my configuration file for changing the prefix when I want to send remote commands to the nested byobu.

This is going to work this way:

Control + a

    • as a prefix for local byobu session.

Control + b

    as a prefix for remote byobu session

Take a look on this screen capture where you can see byobu status bars stacked.

If you find useful the configuration that I described the only thing that you have to do is modify the configuration file: ~/.byobu/keybindings.tmux

unbind-key -n C-a 
set -g prefix C-a
set -g prefix2 F12
unbind-key -n C-b 
bind-key -n C-b send-prefix

I hope this is useful as it is for me.

byobu – screen molt millorat

Reading time: 2 – 2 minutes

A aquestes altures tothom coneix screen i a quin més qui menos li ha solucionat més d’un problema. Pels que no el coneixeu, podeu donar un cop d’ull als posts que vaig fer sobre el tema:

Per començar un screenshot de l’eina:
byobu screenshot

Pel que fa a les funcionalitats hereda tota la potència i accessos ràpids que té screen, a més d’un entorn basat en ncurses per configurar l’aspecte de les pantalles i comportament de l’eina. És genial amb un cop d’ull poder saber les consoles que tenim obertes i monitoritzar el sistema des de la shell. A més també permet instal·lar-se al ~/.profile de l’usuari de forma senzilla (byobu-launcher-install) perquè al fer un login o un ssh tinguem la sessió directament dintre del byobu.

A la Ubuntu Lucid (10.04) i a Fedora 14 ja he trobat el paquet, pel que fa a MeeGo aquest no estava disponible però m’he baixat el tar.gz i compilar-lo ha estat 1s.

La pàgina web de: byobu.

Algunes referències interessants de les tecles d’screen: