Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Shells Virtual Desktop
BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
Shells Virtual Desktop
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

How to send command to unprivileged lxc container and then get back out of it to send more commands?

user3028938user3028938 Member
edited August 2025 in Help

I finally did the extra steps to use unprivileged containers and liking them. :) Nice to feel they are not now running in a properly isolated fashion.

This issue is unrelated to root or none root but that when I send a command with lxc-console the terminal is then stuck somehow in limbo. I don't know how to get out of it or I can use & and it will allow more commands to be sent to the none container terminal but the console will not show the output, however the commands seem to be registering and showing output again once pressing enter.

Here is my script at the moment:

systemd-run --user --scope -p "Delegate=yes" lxc-start unpriv-container
sleep 8
systemd-run --user --scope -p "Delegate=yes" lxc-attach -n unpriv-container --clear-env -- sudo openvpn /home/user/ovpn/profile.ovpn &
sleep 8
#next command

#next command is to be run outside the container, from the host's console.

#next command will run if I use the ampersand but this causes the output to stop showing. It 'works' since I am just running the script and not typing but I would like to know why it is happening and maybe how to do with without the ampersand to get out of the container the correct way.

If I ran the above without the ampersand then the #next command would be run within the container and throw an error.

Oh btw I am using screen with all this but it doesn't seem related to that or not that I have been able to tell as I tried manually doing C-a a Q and various combinations manually to try compensate for C-a being in both and still could not get out of the console when trying the suggested key-bindings with or without the extra a or any other of permutations I could think of.

EDIT: I knew there was a command but I had forgotten and just looked it up again to refresh the terminal when it behaves weirdly like this, which is reset. That worked to show output again but how to prevent the issue in the first place?

Sign In or Register to comment.