How can I make changes to my default shell persistent?

499 views
Skip to first unread message

Noah Vesely

unread,
Jul 17, 2015, 4:23:45 AM7/17/15
to qubes...@googlegroups.com
I'm sure someone has figured this out--how can I make zsh shell default for a given VM? The chsh tool requires I set a user password, then neither the password or shell change persist.

Gorka Alonso

unread,
Jul 17, 2015, 5:00:04 AM7/17/15
to qubes...@googlegroups.com
El viernes, 17 de julio de 2015, 10:23:45 (UTC+2), Noah Vesely escribió:
I'm sure someone has figured this out--how can I make zsh shell default for a given VM? The chsh tool requires I set a user password, then neither the password or shell change persist.

First of all, I have never used chsh. And havent tested this.

They dont persist because the files chsh tries to modify [1] are not persisted / readonly to the VM.  If you are using a template based VM, the chsh command should be launched in the template,  *but* it would change the shell to all VM's based in that template. To avoid that there are different options:

a) Using templates: Copy the default template into a new one, modify (chsh) the new template. Use the custom template in your VM
b) Use a standalone VM

IMHO it is good practice not messing with default templates, network VM, firewall VM could be affected otherwise. If you decide going tweaking default template, consider creating a backup first ;-)


Noah Vesely

unread,
Jul 17, 2015, 5:58:37 AM7/17/15
to qubes...@googlegroups.com
I changed it in my template w/ chsh. Can't have too much zsh. Plus, if a file is needed to be run with #!/bin/bash it will be, so I don't expect any breakage. THANKS POSIX!!

Gorka Alonso

unread,
Jul 17, 2015, 6:24:06 AM7/17/15
to qubes...@googlegroups.com
El viernes, 17 de julio de 2015, 11:58:37 (UTC+2), Noah Vesely escribió:
I changed it in my template w/ chsh. Can't have too much zsh. Plus, if a file is needed to be run with #!/bin/bash it will be, so I don't expect any breakage. THANKS POSIX!!

That is indeed true in your use case, but I mentioned in case future modifications/customizations could break the system. I like leaving default template as-is and copying it before adding repositores (utrusted or untrusted), editing files, etc. 

Example:

default template: As-is. netVM, firewallVM

LAN template: Added repositories, /etc/fstab edited to add entry to local network NAS (user data + backups, samba shares with different users)
- backup VM. Uses LAN template. Specific user 'backup' used in fstab mount via /rw file.
- nas VM:  Uses LAN template. Specific user 'nas' used in fstab mount via /rw file.


☣Adam

unread,
Jul 17, 2015, 8:31:32 AM7/17/15
to Gorka Alonso, qubes...@googlegroups.com
On 7/17/15, Gorka Alonso <ray.br...@gmail.com> wrote:
> El viernes, 17 de julio de 2015, 11:58:37 (UTC+2), Noah Vesely escribió:
>>
>> I changed it in my template w/ chsh. Can't have too much zsh. Plus, if a
>> file is needed to be run with #!/bin/bash it will be, so I don't expect
>> any
>> breakage. THANKS POSIX!!
>>

Also, if you (or any people from the future who come across this post)
want changes on just one AppVM, you could put a sed script in
/rw/config/rc.local to do the replacement at each boot.
Alternatively, you could have a fixed version of your /etc/passwd in
/rw and copy that over using the same mechanism.

Dave Ewart

unread,
Jul 17, 2015, 9:23:19 AM7/17/15
to qubes...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Or, presumably, you could include the appropriate 'chsh' command in
rc.local to achieve the same thing. (Not tried this, but I'm
considering this approach for something similar.)

Dave.

- --
Dave Ewart da...@sungate.co.uk, http://twitter.com/DaveEwart
All email from me is digitally signed, http://www.sungate.co.uk/
GPG key updated Jan 2013 see http://www.sungate.co.uk/gpg
Fingerprint: CF3A 93EF 01E6 16C5 AE7A 1D27 45E1 E473 378B B197
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQQcBAEBCgAGBQJVqQHDAAoJEEXh5HM3i7GXL3ogAKehjNQ3XRrTNG0JSOawFNYr
Mnh+2VotIye5dsRQ7wR6FCQZZ+7JsA2dKwxlnlGrQWizmfmCbv0t3kQWEINCNilI
s1A6zkynxv7wdrYNAbmDrkrRA6WrNlQjvylyRG7Kl7DJQvpMV19f/WmWQpKu0ijb
0VOMc6M80dUCpURBoZ+zRsHhZqr11jHyMnGVnDq+COEZaUoOALn20sU73U1lTr4T
ddHLvySVZNFjw7PWSAPRhw5SwxFCRc9OPF2D88+/22d/Q2y7lKkqC72LdkK42Nju
QzqfsWNRGifyiagUDsLHWq7O8gjFpzh93jSJopn6EZMtOGBFvt1SsOXmMKfdBE9f
TgjDhqhYc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,
Jul 17, 2015, 9:41:49 AM7/17/15
to qubes...@googlegroups.com
On 7/17/15, Dave Ewart <da...@sungate.co.uk> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>
> On Friday, 17.07.2015 at 12:31 +0000, ☣Adam wrote:
>
>> On 7/17/15, Gorka Alonso <ray.br...@gmail.com> wrote:
>> > El viernes, 17 de julio de 2015, 11:58:37 (UTC+2), Noah Vesely
>> > escribió:
>> >>
>> >> I changed it in my template w/ chsh. Can't have too much zsh. Plus, if
>> >> a
>> >> file is needed to be run with #!/bin/bash it will be, so I don't
>> >> expect
>> >> any
>> >> breakage. THANKS POSIX!!
>> >>
>>
>> Also, if you (or any people from the future who come across this post)
>> want changes on just one AppVM, you could put a sed script in
>> /rw/config/rc.local to do the replacement at each boot.
>> Alternatively, you could have a fixed version of your /etc/passwd in
>> /rw and copy that over using the same mechanism.
>
> Or, presumably, you could include the appropriate 'chsh' command in
> rc.local to achieve the same thing. (Not tried this, but I'm
> considering this approach for something similar.)
>
> Dave.

Yeah, chsh would be a much better solution. I didn't even know that
was a thing, I've always just edited /etc/passwd directly. Thanks for
sharing.

echo "zsh" >> ~/.bashrc # :-)

Dave Ewart

unread,
Jul 17, 2015, 10:10:22 AM7/17/15
to qubes...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On Friday, 17.07.2015 at 13:41 +0000, ☣Adam wrote:

> [...]
>
> echo "zsh" >> ~/.bashrc # :-)

Hah! Thank you for some (much needed) Friday afternoon entertainment :-D

Dave.

- --
Dave Ewart da...@sungate.co.uk, http://twitter.com/DaveEwart
All email from me is digitally signed, http://www.sungate.co.uk/
GPG key updated Jan 2013 see http://www.sungate.co.uk/gpg
Fingerprint: CF3A 93EF 01E6 16C5 AE7A 1D27 45E1 E473 378B B197
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQQcBAEBCgAGBQJVqQzLAAoJEEXh5HM3i7GXB3Af/1D/aF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