An very easy and safe way to change template's default shell from bash to zsh for root and user

Original forum link
https://forum.qubes-os.org/t/36940
Original poster
quer
Created at
2025-10-24 20:43:42
Last wiki edit
2025-10-24 20:54:20
Revisions
1 revision
Posts count
4
Likes count
7
Tags
configuration, template, version-r42, version-r43

Bash lacks support for autosuggestions and syntax highlighting.Fish is great, but its incompatibility with Bash syntax leads to some compatibility issues.Zsh is the only option left.

The whonix template come with a default zsh config and it work in other distro too.So you don't have to install OhMyZsh or anything else in your template.

  1. apt install zsh-autosuggestions zsh-common zsh or dnf install zsh zsh-autosuggestions zsh-syntax-highlighting
  2. cd to /etc/zsh/ in whonix-gateway template and delete /etc/zsh/zshrc and /etc/zsh/zprofile otherwise copy to other vm wil fail.
  3. Copy /etc/zsh/ from whonix-gateway template to fedora/debiantemplete and replace the original /etc/zsh if exists.
  4. In debian, run
    ln -s /etc/zsh/zprofile.dist /etc/zsh/zprofile
    ln -s /etc/zsh/zshrc.dist /etc/zsh/zshrc
    
  5. In fedora, run
    rm /etc/zshrc /etc/zprofile
    ln -s /etc/zsh/zprofile.dist /etc/zprofile
    ln -s /etc/zsh/zshrc.dist /etc/zshrc
    
  6. Change shell
    sudo chsh -s /usr/bin/zsh user
    sudo chsh -s /usr/bin/zsh
    
  7. Create empty ~/.zshrc in template's. For the appvm that already create, just select 0 when you first launch zsh.

Now you can use zsh everywhere with autosuggestions and syntax-highlighting Screenshot_2025-10-25_04-51-20|590x297