LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-23-2018, 08:27 AM   #1
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,682

Rep: Reputation: 513Reputation: 513Reputation: 513Reputation: 513Reputation: 513Reputation: 513
Starting LXC GUI container from FVWM


I use the following Bash script to start my firefox LXC container:
Code:
#!/usr/bin/env bash

TIMEOUT=${TIMEOUT:-10}

CONTAINER=firefox
LXC_PATH="${LXC_PATH:-$HOME/.local/share/lxc}"
LXC_USER=${LXC_USER:-user}
LXC_HOME=/home/$LXC_USER
STARTED=false

CMD_LINE="sudo -i -u $LXC_USER env DISPLAY=$DISPLAY firefox --new-instance $*"

if ! lxc-wait -n $CONTAINER -P "$LXC_PATH" -s RUNNING -t 0; then
    lxc-start -n $CONTAINER -P "$LXC_PATH" -d 2>/dev/null

    # check if container started successfully; exit on error
    lxc-wait -n $CONTAINER -P "$LXC_PATH" -s RUNNING -t $TIMEOUT || exit 1

    STARTED=true
fi

lxc-attach --clear-env -n $CONTAINER -P "$LXC_PATH" -- $CMD_LINE

if [ "$STARTED" = "true" ]; then
    lxc-stop -n $CONTAINER -P $LXC_PATH -t $TIMEOUT
fi
It all works well if I execute this script from a terminal, however, if I try to start it from my .fvwm2rc configuration file, then the LXC container does start but Firefox never shows up. This is how I start it from within the FVWM configuration file:
Code:
...
+ "&3. Firefox" Exec exec /home/user/bin/startfirefox
...
So I thought it might be a good idea to capture a log and see what may prohibit Firefox from running. Thus, I added the following line to my start script:
Code:
#!/usr/bin/env bash

exec &>$HOME/lxc-fox.log
...
No changes were made to the FVWM configuration file but that simple redirection made it work. Firefox does start and shows up on the display.

Can anyone explain this behaviour?

PS: Running Slackware 14.2 64bit with FVWM 2.6.6.

Last edited by crts; 07-23-2018 at 08:29 AM.
 
Old 07-23-2018, 08:39 AM   #2
mralk3
Senior Member
 
Registered: May 2015
Location: Utah, USA
Distribution: Slackware 14.2 || Slackware-current && CentOS
Posts: 1,371

Rep: Reputation: 735Reputation: 735Reputation: 735Reputation: 735Reputation: 735Reputation: 735Reputation: 735
Sorry for the off topic question, but does sound work with pulse audio to view videos and such? I've been using firejail to run Firefox and really want to use a similar set up as yours.
 
Old 07-23-2018, 08:46 AM   #3
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,682

Original Poster
Rep: Reputation: 513Reputation: 513Reputation: 513Reputation: 513Reputation: 513Reputation: 513
Quote:
Originally Posted by mralk3 View Post
Sorry for the off topic question, but does sound work with pulse audio to view videos and such? I've been using firejail to run Firefox and really want to use a similar set up as yours.
No, sound is not working.
 
1 members found this post helpful.
Old 07-23-2018, 09:16 AM   #4
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Rep: Reputation: 1235Reputation: 1235Reputation: 1235Reputation: 1235Reputation: 1235Reputation: 1235Reputation: 1235Reputation: 1235Reputation: 1235
Quote:
Originally Posted by mralk3 View Post
Sorry for the off topic question, but does sound work with pulse audio to view videos and such? I've been using firejail to run Firefox and really want to use a similar set up as yours.
A LXC container is essentially "another computer", so you need a solution of audio over network.

For example, see https://wiki.archlinux.org/index.php...o_over_network
 
  


Reply

Tags
lxc fvwm firefox


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware as an LXC Container upnort Slackware 1 12-10-2017 05:48 PM
[SOLVED] Starting LXC container in Slackware 14.2 crts Slackware 9 10-21-2017 08:05 AM
[SOLVED] Running ctdb in an LXC container PeterSteele CentOS 5 08-13-2015 07:45 AM
How to end a Linux Container (LXC) from within? Skaperen Linux - Virtualization and Cloud 0 06-14-2011 09:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration