0

I have a Raspberry Pi 2 on which I'm running Octopi, which is basically a headless installation of Raspbian Buster. It runs a web application from which I can remotely control a 3D printer.

Now, I would like to run a desktop application on it and display it remotely on a browser on the same network, much like you can do for the 3D printer control. The application in question is Prusa Slicer. I tried running Prusa Slicer on a Linux Mint machine via PuTTY and it's doable, although my Mint computer is a fully fledged desktop environment, with an X server and all the bells and whistles.

Is this possible while maintaining the Buster installation headless? Is this even possible at all?

  • 1
    Have you tried installing the app in question on Buster? – Dmitry Grigoryev Apr 22 '20 at 9:12
  • @DmitryGrigoryev not yet, the application is a .appimage package, if it makes any difference. – vale.maio2 Apr 22 '20 at 9:27
  • "Headless" really refers to a hardware configuration (there's no physical human interface), not a software one, although there are obviously software configurations more and less tailored to it. So yes, you can install a GUI, a web browser, access that remotely and/or attach a monitor and control that remotely, etc. It is not going to mean the Pi will suddenly sprout a head and start talking back to you ;) – goldilocks Apr 22 '20 at 14:00
  • @goldilocks OK sorry, bad wording then :) By headless I mean it doesn't have a GUI installed, it is intended to be used remotely from any browser in the same network. My question then is, can it be used to run an .appimage application the same way, from a remote browser? – vale.maio2 Apr 22 '20 at 14:49
  • My point was that yes, you can install a GUI on a headless system without hindering the potential to use it headless. You could be doing whatever you are doing with the "full" version of Raspbian or Raspbian lite, it doesn't really matter. The point of the light version is to save including a ton of software that you aren't going to use. They use the same repository (I'm guessing so does octopi, since it would probably be silly to maintain one separately just for that). – goldilocks Apr 22 '20 at 15:16
2

The key requirement is:

I would like to run a desktop application on it

For this you need a graphical interface. On Linux it is at least the xserver-xorg. Installing it on a light installation will leave a big footprint but it does not install all bells and whistles of a complete desktop. It only provides the GUI you can also connect remotely. Assuming you have a lean Raspbian Buster Light installation without any graphical support, you can make a reduced installation:

pi@raspberrypi ~$ sudo apt install --no-install-recommends xserver-xorg

After this installation and a reboot you should be able to execute remotely a graphical program on the RasPi and have its window on your management client machine with a complete Desktop using X window, e.g. Raspbian Buster With Desktop. For testing I just installed sudo apt install x11-apps with some nice little helpers on the RasPi. From the management machine I execute the clock on the RasPi with:

mngmt ~$ ssh -Y pi@raspberrypi.local xclock

The clock is running on the RasPi but its window is shown on the management machine. You see the time on the RasPi. That is working with any graphical program and should also do with your program.

  • Ok that's a great start, thank you! I think the RPi can handle a basic GUI and the constant sending of GCODE to the printer. As I said on the original post it does work in Windows via PuTTY (at least from Mint, can't see why it won't work from Raspbian); is it possible opening the app from, say, Firefox instead of PuTTY? – vale.maio2 Apr 22 '20 at 20:40
  • @vale.maio2 Firefox is made to show (http) sides from a web server so you have to run a web server on the RasPi. As far as I understood this was not your intention. But you can run firefox on the RasPi but show its window on the management machine. Maybe you can direct connect to the web server the app is running on? – Ingo Apr 22 '20 at 21:06
  • I think Octoprint uses a web server, although I'm not sure which one. Netstat -tnlp shows that ports 80 and 443 are being used by haproxy but, as far as I know, it's not technically a web server...? Right? – vale.maio2 Apr 22 '20 at 21:14
  • @vale.maio2 I don't know anything about your environment, so I cannot say much about it. But port 80 and 443 are reserved ports for http (80) and https (443). Maybe you can connect with your browser to the ip address that has this ports open? – Ingo Apr 22 '20 at 21:52
  • Indeed. When connecting to the RPi IP address on port 80, the Octoprint web UI launches as expected. I was wondering if I could do a similar thing with another application running on the RPi. – vale.maio2 Apr 22 '20 at 22:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.