You are not logged in.

#1 2020-03-23 14:46:58

TheMagistrator
Member
Registered: 2020-03-23
Posts: 2

[SOLVED] run graphical app in systemd-nspawn

Hello Arch users !

I would like to run a proprio app in a minimal VM.
VirtualBox is too heavy.

I am trying to run it into systemd-nspawn but I am facing some difficulties because it is a graphical app.
I played with the following commands:

debootstrap --arch=amd64 stretch deb9
systemd-nspawn -D myContainer
passwd
logout
apt-get update
apt-get install xorg build-essential libgtk2.0-0 libnss3 libasound2 
apt-get install matlab-support

Then:

systemd-nspawn --bind-ro=/dev/dri --bind=/tmp/.X11-unix --bind=/opt/MATLAB/R2018a/ -b -D deb9
export DISPLAY=:0

I am able to install and boot the "guest" system but cannot launch the app.
Do you have any idea?

Many thanks!

Last edited by TheMagistrator (2020-04-06 12:36:30)

Offline

#2 2020-03-23 16:19:00

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,701

Re: [SOLVED] run graphical app in systemd-nspawn

Not an answer to your question, but rather a tangential suggestion;  If VirtualBox is too heavy, have you considered Qemu
https://wiki.archlinux.org/index.php/QEMU


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#3 2020-03-23 17:53:25

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] run graphical app in systemd-nspawn

TheMagistrator wrote:
systemd-nspawn --bind-ro=/dev/dri --bind=/tmp/.X11-unix --bind=/opt/MATLAB/R2018a/ -b -D deb9
export DISPLAY=:0

I am able to install and boot the "guest" system but cannot launch the app.
Do you have any idea?

Many thanks!


What does "cannot launch the app" mean? Does it come with error messages?

https://wiki.archlinux.org/index.php/Ge … /checklist

...

P.S. If you get an error such as "could not connect to display :0" then you have probably failed to grant access via $XAUTHORITY or `xhost`, to your Xorg server.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#4 2020-04-06 12:35:57

TheMagistrator
Member
Registered: 2020-03-23
Posts: 2

Re: [SOLVED] run graphical app in systemd-nspawn

Thanks a lot guys,
I am now using qemu which best fit my need.
bye!

Last edited by TheMagistrator (2020-04-06 12:36:13)

Offline

#5 2020-04-06 12:45:16

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] run graphical app in systemd-nspawn

TheMagistrator wrote:

I am now using qemu which best fit my need.

That's not a solution, it's a work-around.

To run graphical applications from systemd-nspawn see http://forums.debian.net/viewtopic.php?f=16&t=129390

tl;dr:

# systemd-nspawn --directory=/var/lib/container/sid --setenv=DISPLAY=:0 --user=$user $application

Replace $user & $application with the appropriate values.


Jin, Jîyan, Azadî

Offline

Board footer

Powered by FluxBB