[SOLVED] HOME Variable is not set // mcedit does not work in the debian container

adams13

New Member
Oct 11, 2023
5
2
3
Hi!
I have installed proxmox 8.1.3 and "debian-11-standard" container using https://github.com/bashclub/zamba-lxc-toolbox.
I have installed midnight commander ("apt-get install mc") in both proxmox pve and the container.

When I run "mc" from the web console in the host OS (Datacenter -> pve -> shell), it works.
When I run "mc" from the web console in the container OS (Datacenter -> pve -> "100 my container" -> shell), it does not work as expected.

1. Functional keys did not work ("*" instead of "F3" etc.) --> solved by adding TERM=xterm-256color into /root/.bashrc as suggested here and here.
2. The problem: if I press "F4" to edit the file, a dialog comes to choose the editor to use. When I choose the editor, a file .selected_editor is saved to the root of the file system (/) instead of my "home directory" (/root). The editor does not start.

I have checked where the program /usr/bin/select-editor saves the file, it uses the $HOME variable, it is empty. echo $HOME shows an empty string.

The $HOME variable is not set for the container root user in the web-console.

However, it works as expected for other users (su testuser) and when I change the user twice (su testuser and then su)

It looks like something is not initialized in the web console. Where the $HOME variable should be set, what am I missing?


EDIT: Adding HOME=/root into /root/.bashrc does not make a trick: echo $HOME starts to show /root, but "F4" in midnight commander still asks to set an editor and does not work.
 
Last edited:
Well, it should have been some glitch. The problem solved by changing the root password and rebooting the container; now it asks for user name and password when I open the (web) console and sets the HOME variable properly.