Change in default application Path in Template VM doesn't apply to Service VM

Hello, the default tor-control-panel PATH is /usr/bin/tor-control-panel in whonix-gateway-17 template, and sys-whonix service VM derives the PATH from it. Here is how my PATH variable looks like inside whonix-gateway-17 template when I hit echo $PATH:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

I needed to make /usr/libexec/tor-control-panel/tor-control-panel path to take precedence over /usr/bin/tor-control-panel. So, understanding /usr/local/bin comes before /user/bin in the PATH, I created a soft link named “tor-control-panel” inside /usr/local/bin.

ln -sf /usr/libexec/tor-control-panel/tor-control-panel /usr/local/bin/tor-control-panel

And then, I rechecked inside whonix-gateway-17 template using “which tor-control-panel” command, and the result came as “/usr/local/bin/tor-control-panel” instead of “/usr/bin/control-panel”, which is exactly what I wanted.

However, when I shut-down the template VM and restarted sys-whonix Service VM, it still showed the PATH for tor-control-panel as “/usr/bin/tor-control-panel”. It didn’t reflect the change I make in whonix-gateway-17 template VM.

Upon inquiring “whereis tor-control-panel”, it did not list “/usr/local/bin/tor-control-panel” in the PATH. So, I’d like to understand what is missing, and why the change in PATH I make in whonix-gateway-17 template VM doesn’t reflect inside sys-whonix Service VM.

It’s because /rw/usrlocal is mounted to /usr/local in appvm and its not using /usr/local from template:

[gateway user ~]% cat /etc/fstab | grep /rw
/dev/xvdb		/rw			auto	noauto,defaults,discard,nosuid,nodev	1 2
/rw/home        /home       none    noauto,bind,defaults,nosuid,nodev 0 0
/rw/usrlocal        /usr/local       none    noauto,bind,defaults 0 0
3 Likes

Perfect! Thank you, apparatus, for your valuable insight; it really helped.

Inside whonix-gateway-17 template, I moved the symlink “tor-control-panel” from /usr/local/bin/ to /usr/sbin/, and it worked. Actually, I was in the process of scaling window and font size, so I added QT_SCALE_FACTOR=2 in /usr/libexec/tor-control-panel/tor-control-panel file (sudo QT_SCALE_FACTOR=2 /usr/bin/tor-control-panel) as the global setting in /etc/environment did not work for this application.

1 Like