Start a screen session inside LXD-managed container Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Working with screen sessions in LXD-managed containersWorking with screen sessions in LXD-managed containersSystemd fails to start openvpn in lxd managed 16.04 containerRunning Ubuntu Desktop in LXC/LXD on top of Ubuntu ServerHow to set up X11 forwarding in byobu inside a LXC container(LXD) LXC container not starting services automaticallyUlimit for user asterisk inside an LXD containerLXD unable to start containerDisable IPv6 from boot inside LXD/LXC containerLXD Containers and Host on DHCPQuota inside LXD container
How to motivate offshore teams and trust them to deliver?
Why was the term "discrete" used in discrete logarithm?
Should I use Javascript Classes or Apex Classes in Lightning Web Components?
ListPlot join points by nearest neighbor rather than order
The logistics of corpse disposal
Why don't the Weasley twins use magic outside of school if the Trace can only find the location of spells cast?
How much radiation do nuclear physics experiments expose researchers to nowadays?
Disable hyphenation for an entire paragraph
Storing hydrofluoric acid before the invention of plastics
How widely used is the term Treppenwitz? Is it something that most Germans know?
Gastric acid as a weapon
How to bypass password on Windows XP account?
Why is "Captain Marvel" translated as male in Portugal?
Does accepting a pardon have any bearing on trying that person for the same crime in a sovereign jurisdiction?
How to assign captions for two tables in LaTeX?
Stars Make Stars
Is above average number of years spent on PhD considered a red flag in future academia or industry positions?
Is high blood pressure ever a symptom attributable solely to dehydration?
When is phishing education going too far?
Should gear shift center itself while in neutral?
What is the musical term for a note that continously plays through a melody?
Check which numbers satisfy the condition [A*B*C = A! + B! + C!]
When to stop saving and start investing?
How do I stop a creek from eroding my steep embankment?
Start a screen session inside LXD-managed container
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Working with screen sessions in LXD-managed containersWorking with screen sessions in LXD-managed containersSystemd fails to start openvpn in lxd managed 16.04 containerRunning Ubuntu Desktop in LXC/LXD on top of Ubuntu ServerHow to set up X11 forwarding in byobu inside a LXC container(LXD) LXC container not starting services automaticallyUlimit for user asterisk inside an LXD containerLXD unable to start containerDisable IPv6 from boot inside LXD/LXC containerLXD Containers and Host on DHCPQuota inside LXD container
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'd like to start a screen
session inside an LXD-managed container so that I could detach running processes and maybe re-attach in the future when I want to check on their status.
I tried to attach to the container running
$ lxc exec my-ubuntu -- /bin/bash
and then start a session with screen -x
, but I get the following error:
Must be connected to a terminal.
I can see that many people have had a similar problem when trying to initiate screen
from ssh
, but I couldn't apply the suggested solution to my case.
lxc gnu-screen lxd
add a comment |
I'd like to start a screen
session inside an LXD-managed container so that I could detach running processes and maybe re-attach in the future when I want to check on their status.
I tried to attach to the container running
$ lxc exec my-ubuntu -- /bin/bash
and then start a session with screen -x
, but I get the following error:
Must be connected to a terminal.
I can see that many people have had a similar problem when trying to initiate screen
from ssh
, but I couldn't apply the suggested solution to my case.
lxc gnu-screen lxd
add a comment |
I'd like to start a screen
session inside an LXD-managed container so that I could detach running processes and maybe re-attach in the future when I want to check on their status.
I tried to attach to the container running
$ lxc exec my-ubuntu -- /bin/bash
and then start a session with screen -x
, but I get the following error:
Must be connected to a terminal.
I can see that many people have had a similar problem when trying to initiate screen
from ssh
, but I couldn't apply the suggested solution to my case.
lxc gnu-screen lxd
I'd like to start a screen
session inside an LXD-managed container so that I could detach running processes and maybe re-attach in the future when I want to check on their status.
I tried to attach to the container running
$ lxc exec my-ubuntu -- /bin/bash
and then start a session with screen -x
, but I get the following error:
Must be connected to a terminal.
I can see that many people have had a similar problem when trying to initiate screen
from ssh
, but I couldn't apply the suggested solution to my case.
lxc gnu-screen lxd
lxc gnu-screen lxd
asked Jan 2 '16 at 15:53
Jonathan Y.Jonathan Y.
5041128
5041128
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
For LXD using
lxc exec my-ubuntu -- sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -s /bin/bash"
or
lxc exec my-ubuntu -- sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -x"
or with any other screen
switch.
The same for Docker
;)
docker run -it my-ubuntu sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -s /bin/bash"
Terrific. But how can I then work withscreen
the way I normally do, monitor which sessions are running and re-attach to a specific one?
– Jonathan Y.
Jan 2 '16 at 19:40
I don't understand. In the same way as before. E.g. using-R
.
– A.B.
Jan 2 '16 at 19:42
Answer updated.
– A.B.
Jan 2 '16 at 19:45
Well, I would normally doscreen -x
, but tryinglxc exec my-ubuntu -- sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -x
doesn't work, and neither doeslxc exec my-ubuntu -- sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -r <pid>.tty.my-ubuntu"
. Nor can I doscreen -x
from within bash in the container.
– Jonathan Y.
Jan 2 '16 at 19:48
What's about-R
– A.B.
Jan 2 '16 at 19:51
|
show 3 more comments
For me, the simple solution was to start screen on the host instead of in the container.
user@localhost:~$ screen
user@localhost:~$ lxc-attach -n yourcontainer
root@container:~# ./start-gameserver.sh
root@container:~# #Use "Ctrl+A:sessionname mygame<Enter>" to set a screen name
root@container:~# #and use the usual "Ctrl+A,D" to disconnect from screen
user@localhost:~$ screen -ls
There is a screen on:
25418.mygame (04/15/2019 11:41:56 PM) (Detached)
user@localhost:~$ screen -r mygame
root@container:~# #etc.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f716028%2fstart-a-screen-session-inside-lxd-managed-container%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
For LXD using
lxc exec my-ubuntu -- sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -s /bin/bash"
or
lxc exec my-ubuntu -- sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -x"
or with any other screen
switch.
The same for Docker
;)
docker run -it my-ubuntu sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -s /bin/bash"
Terrific. But how can I then work withscreen
the way I normally do, monitor which sessions are running and re-attach to a specific one?
– Jonathan Y.
Jan 2 '16 at 19:40
I don't understand. In the same way as before. E.g. using-R
.
– A.B.
Jan 2 '16 at 19:42
Answer updated.
– A.B.
Jan 2 '16 at 19:45
Well, I would normally doscreen -x
, but tryinglxc exec my-ubuntu -- sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -x
doesn't work, and neither doeslxc exec my-ubuntu -- sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -r <pid>.tty.my-ubuntu"
. Nor can I doscreen -x
from within bash in the container.
– Jonathan Y.
Jan 2 '16 at 19:48
What's about-R
– A.B.
Jan 2 '16 at 19:51
|
show 3 more comments
For LXD using
lxc exec my-ubuntu -- sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -s /bin/bash"
or
lxc exec my-ubuntu -- sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -x"
or with any other screen
switch.
The same for Docker
;)
docker run -it my-ubuntu sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -s /bin/bash"
Terrific. But how can I then work withscreen
the way I normally do, monitor which sessions are running and re-attach to a specific one?
– Jonathan Y.
Jan 2 '16 at 19:40
I don't understand. In the same way as before. E.g. using-R
.
– A.B.
Jan 2 '16 at 19:42
Answer updated.
– A.B.
Jan 2 '16 at 19:45
Well, I would normally doscreen -x
, but tryinglxc exec my-ubuntu -- sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -x
doesn't work, and neither doeslxc exec my-ubuntu -- sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -r <pid>.tty.my-ubuntu"
. Nor can I doscreen -x
from within bash in the container.
– Jonathan Y.
Jan 2 '16 at 19:48
What's about-R
– A.B.
Jan 2 '16 at 19:51
|
show 3 more comments
For LXD using
lxc exec my-ubuntu -- sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -s /bin/bash"
or
lxc exec my-ubuntu -- sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -x"
or with any other screen
switch.
The same for Docker
;)
docker run -it my-ubuntu sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -s /bin/bash"
For LXD using
lxc exec my-ubuntu -- sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -s /bin/bash"
or
lxc exec my-ubuntu -- sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -x"
or with any other screen
switch.
The same for Docker
;)
docker run -it my-ubuntu sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -s /bin/bash"
edited Jan 2 '16 at 19:45
answered Jan 2 '16 at 16:31
A.B.A.B.
69.9k12173267
69.9k12173267
Terrific. But how can I then work withscreen
the way I normally do, monitor which sessions are running and re-attach to a specific one?
– Jonathan Y.
Jan 2 '16 at 19:40
I don't understand. In the same way as before. E.g. using-R
.
– A.B.
Jan 2 '16 at 19:42
Answer updated.
– A.B.
Jan 2 '16 at 19:45
Well, I would normally doscreen -x
, but tryinglxc exec my-ubuntu -- sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -x
doesn't work, and neither doeslxc exec my-ubuntu -- sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -r <pid>.tty.my-ubuntu"
. Nor can I doscreen -x
from within bash in the container.
– Jonathan Y.
Jan 2 '16 at 19:48
What's about-R
– A.B.
Jan 2 '16 at 19:51
|
show 3 more comments
Terrific. But how can I then work withscreen
the way I normally do, monitor which sessions are running and re-attach to a specific one?
– Jonathan Y.
Jan 2 '16 at 19:40
I don't understand. In the same way as before. E.g. using-R
.
– A.B.
Jan 2 '16 at 19:42
Answer updated.
– A.B.
Jan 2 '16 at 19:45
Well, I would normally doscreen -x
, but tryinglxc exec my-ubuntu -- sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -x
doesn't work, and neither doeslxc exec my-ubuntu -- sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -r <pid>.tty.my-ubuntu"
. Nor can I doscreen -x
from within bash in the container.
– Jonathan Y.
Jan 2 '16 at 19:48
What's about-R
– A.B.
Jan 2 '16 at 19:51
Terrific. But how can I then work with
screen
the way I normally do, monitor which sessions are running and re-attach to a specific one?– Jonathan Y.
Jan 2 '16 at 19:40
Terrific. But how can I then work with
screen
the way I normally do, monitor which sessions are running and re-attach to a specific one?– Jonathan Y.
Jan 2 '16 at 19:40
I don't understand. In the same way as before. E.g. using
-R
.– A.B.
Jan 2 '16 at 19:42
I don't understand. In the same way as before. E.g. using
-R
.– A.B.
Jan 2 '16 at 19:42
Answer updated.
– A.B.
Jan 2 '16 at 19:45
Answer updated.
– A.B.
Jan 2 '16 at 19:45
Well, I would normally do
screen -x
, but trying lxc exec my-ubuntu -- sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -x
doesn't work, and neither does lxc exec my-ubuntu -- sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -r <pid>.tty.my-ubuntu"
. Nor can I do screen -x
from within bash in the container.– Jonathan Y.
Jan 2 '16 at 19:48
Well, I would normally do
screen -x
, but trying lxc exec my-ubuntu -- sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -x
doesn't work, and neither does lxc exec my-ubuntu -- sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/screen -r <pid>.tty.my-ubuntu"
. Nor can I do screen -x
from within bash in the container.– Jonathan Y.
Jan 2 '16 at 19:48
What's about
-R
– A.B.
Jan 2 '16 at 19:51
What's about
-R
– A.B.
Jan 2 '16 at 19:51
|
show 3 more comments
For me, the simple solution was to start screen on the host instead of in the container.
user@localhost:~$ screen
user@localhost:~$ lxc-attach -n yourcontainer
root@container:~# ./start-gameserver.sh
root@container:~# #Use "Ctrl+A:sessionname mygame<Enter>" to set a screen name
root@container:~# #and use the usual "Ctrl+A,D" to disconnect from screen
user@localhost:~$ screen -ls
There is a screen on:
25418.mygame (04/15/2019 11:41:56 PM) (Detached)
user@localhost:~$ screen -r mygame
root@container:~# #etc.
add a comment |
For me, the simple solution was to start screen on the host instead of in the container.
user@localhost:~$ screen
user@localhost:~$ lxc-attach -n yourcontainer
root@container:~# ./start-gameserver.sh
root@container:~# #Use "Ctrl+A:sessionname mygame<Enter>" to set a screen name
root@container:~# #and use the usual "Ctrl+A,D" to disconnect from screen
user@localhost:~$ screen -ls
There is a screen on:
25418.mygame (04/15/2019 11:41:56 PM) (Detached)
user@localhost:~$ screen -r mygame
root@container:~# #etc.
add a comment |
For me, the simple solution was to start screen on the host instead of in the container.
user@localhost:~$ screen
user@localhost:~$ lxc-attach -n yourcontainer
root@container:~# ./start-gameserver.sh
root@container:~# #Use "Ctrl+A:sessionname mygame<Enter>" to set a screen name
root@container:~# #and use the usual "Ctrl+A,D" to disconnect from screen
user@localhost:~$ screen -ls
There is a screen on:
25418.mygame (04/15/2019 11:41:56 PM) (Detached)
user@localhost:~$ screen -r mygame
root@container:~# #etc.
For me, the simple solution was to start screen on the host instead of in the container.
user@localhost:~$ screen
user@localhost:~$ lxc-attach -n yourcontainer
root@container:~# ./start-gameserver.sh
root@container:~# #Use "Ctrl+A:sessionname mygame<Enter>" to set a screen name
root@container:~# #and use the usual "Ctrl+A,D" to disconnect from screen
user@localhost:~$ screen -ls
There is a screen on:
25418.mygame (04/15/2019 11:41:56 PM) (Detached)
user@localhost:~$ screen -r mygame
root@container:~# #etc.
answered 4 hours ago
LucLuc
51649
51649
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f716028%2fstart-a-screen-session-inside-lxd-managed-container%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown