0

I created a new container using lxc on my ubuntu platform, created a sudo user, installed Uhd and finally gnuradio. However, when I try to run gnuradio I get the following error:

~$ sudo gnuradio-companion
Traceback (most recent call last):

File "/usr/local/bin/gnuradio-companion", line 97, in <module>
check_gtk()

File "/usr/local/bin/gnuradio-companion", line 64, in check_gtk
die(err, "Failed to initialize GTK. If you are running over ssh, "

File "/usr/local/bin/gnuradio-companion", line 42, in die
import gtk

File "/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py", line 69, in <module>
_init()

File "/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py", line 57, in _init

warnings.warn(str(e), _gtk.Warning)

gtk.GtkWarning: could not open display

I have tried several methods found here to try to fix this issue with gtk.GtkWarning when I attempt to run gnuradio and none have worked. I am fairly new to gnuradio, ubuntu, and lxc containers. I tried running the program from outside the container as root as well as with the sudo user. Can anyone help me with this?

Marcello B.
  • 4,177
  • 11
  • 45
  • 65
BDunn
  • 1
  • 1
  • To be honest, lxc containers simply aren't meant to run GUI applications. Use GRC on your native Ubuntu, and then transfer your python flow graph implementations to the LXC container (since I only know one place where LXC is used for UHD+GR deployments, deploying things in containers is something you'll need to get used to, anyway) – Marcus Müller Jul 21 '17 at 20:42
  • So would would we be able to use several uhd versions in different containers then export to GRC on the native Ubuntu? We have many different radios that need different UHD versions, we were hoping containers might be a way to remedy this issue. – BDunn Jul 24 '17 at 15:28

1 Answers1

0

I solved this problem using this inside of a docker container:

apt-get update
apt-get install Xvfb
Xvfb :1 -screen 0 1024x768x16 &> xvfb.log  &
DISPLAY=:1.0
export DISPLAY

After, run the program.

Marcello B.
  • 4,177
  • 11
  • 45
  • 65