Start a screen session inside LXD-managed containerWorking 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 Server(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
Examples of "unsuccessful" theories with afterlives
How to deal with my team leader who keeps calling me about project updates even though I am on leave for personal reasons?
If the EU does not offer an extension to UK's Article 50 invocation, is the Benn Bill irrelevant?
Is it possible to encode a message in such a way that can only be read by someone or something capable of seeing into the very near future?
Can an integer optimization problem be convex?
Safely hang a mirror that does not have hooks
Drawing line in notebook with Mathematica command
Social leper versus social leopard
How to make interviewee comfortable interviewing in lounge chairs
What benefits does the Power Word Kill spell have?
Co-Supervisor comes to office to help her students which distracts me
What do you do if you have developments on your paper during the long peer review process?
To what extent is it worthwhile to report check fraud / refund scams?
2000s Animated TV show where teenagers could physically go into a virtual world
1, 2, 4, 8, 16, ... 33?
What is the meaning of "heutig" in this sentence?
Resolving moral conflict
Does Fires of Invention allow adventure instant and sorceries to be played for free?
What's the story to "WotC gave up on fixing Polymorph"?
A food item only made possible by time-freezing storage?
How can this Stack Exchange site have an animated favicon?
My Project Manager does not accept carry-over in Scrum, Is that normal?
Worms crawling under skin
Can a broken/split chain be reassembled?
Start a screen session inside LXD-managed container
Working 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 Server(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.
50412 silver badges30 bronze badges
50412 silver badges30 bronze badges
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/4.0/"u003ecc by-sa 4.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.
72.6k12 gold badges187 silver badges277 bronze badges
72.6k12 gold badges187 silver badges277 bronze badges
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 Apr 15 at 21:47
LucLuc
5745 silver badges10 bronze badges
5745 silver badges10 bronze badges
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