X11 Forwarding Adventures

mach_kernel

Administrator
Dec 26, 2019
23
23
3
New York City
github.com
Since laptops are much lighter than an Octane, the only real way you can sit on the couch and fiddle is by trying out X11 forwarding. Here are some of my notes!

tldr: It's iglx!

Getting Started
  • Edit your sshd_config
    • X11Forwarding Yes
    • X11UseLocalhost No
  • Restart sshd
  • Client
    • ~/.ssh/config
    • Host my.octane.lan -> forwarding yes
  • SGI desktop preferences have a checkbox somewhere that is titled "Show application errors in console" or something similar. You may want to enable this to get logs of stuff dying. You can also invoke stuff like toolchest directly from your shell. Up to you.
Attempt 1: XQuartz

Toolchest, system manager, and a few of the preference apps work fine. Icon catalog does not launch, and leaves us with this error:

Code:
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  139 (XINERAMA)
  Minor opcode of failed request:  1 (XINERAMAGetState)
  Resource id in failed request:  0x11010000
  Serial number of failed request:  665
  Current serial number in output stream:  665
Looks like another Mac user trying to talk to an SGI is having trouble as well. At this point I thought, let's see if it's XQuartz -- so I grabbed the latest Ubuntu OVA and loaded it up in VMware Fusion.

Intermission: Configuring the VM

Maybe not directly related, but if you don't want to go digging around for a flash disk and/or reboot just to try out Xorg:
  • Your guest needs to be bridged so it gets an IP on your LAN
  • Saw a bunch of forum posts that you cannot do bridged networking over your wireless network connection, but it does work
    • The VM NIC is an ethernet adapter
    • Your wireless NIC doesn't have the same link state (probably) as the virtual ethernet adapter
      • My VMware fusion didn't have the "replicate physical link state" checkbox, but supposedly this solves the issue on VMware workstation
    • VM guest won't autoconfigure the interface properly
  • Give the guest a static IP
    • Everything should work fine
    • Sometimes, the host will time out trying to reach the internet (?), I had to cycle my wifi connection a few times. Both do work simultaneously and I chalk this up to shitty driver

Attempt 2: Xorg

Launching toolchest again yields this, which is not the most fun discovery after sinking about 40 min into getting the VM guest on my LAN.

1605883347985.png


Luckily, this UNIX StackExchange thread suggested enabling IGLX for remote OpenGL goodness. Let's try that again:
1605883684032.png

It launches, but takes over GNOME in a spectacular (read: terrible) fashion. The system is unusable and I can't even switch to a tty, so I kill the VM. On reboot, I decide to install Fluxbox: there's no fancy compositor to upset. Upon restarting gdm, something good happened:


ezgif-6-84e5437b37ed.gif


After killing the VM a third time I decided to try again after logging into Fluxbox. And would you look at that!

1605883996816.png

There's the icon catalog in all its glory! I did try the XQuartz instructions to no avail, but it would be nice if we could get this working with native macOS X11. Otherwise, if anyone is interested in taking this journey, hope that these notes helped!
 

Attachments

mach_kernel

Administrator
Dec 26, 2019
23
23
3
New York City
github.com
  • Like
Reactions: Elf

flexion

Active member
Sep 23, 2020
196
137
43
Switzerland
nice! I simply use Xnest in ubuntu to launch a remote x-session. works quite well, but of course only for "2D" apps.
 

massiverobot

irix detailer
Feb 8, 2019
121
108
43
Philly
twitter.com
Yes- Mach your suggestion to use fluxbox finally got XDM working. It's GDM and gnome which has been blocking things for a while and preventing a working XDM login. I setup a more classic Ubuntu one that is a little more light-weight (Ubuntu 10.04) and it works great. By setup I mean I created this in Vmware Fusion on my MacPro. I used bridged networking.

After you install the VM and re-direct the repos to the 'old-' urls and install fluxbox, you choose it when logging in. Then use xrandr to setup a proper screensize for the VM on the Mac. Then use Xnest with a good geometry setting and you have the entire 4DM experience ready to use!

$ Xnest :1 -geometry 1280x840+0+0 -query fuel.diller.org

I set my ubuntu size to 1440x900.

Then you get this:
Screen Shot 2020-11-22 at 10.55.58 AM.png



Screen Shot 2020-11-22 at 10.59.11 AM.png



SO nice!

Thanks Mach for the breakthru!

Now if this would work in xQuartz we wouldn't need the ubunu VM.
 
  • Like
  • Love
Reactions: Elf and mach_kernel

stormy

Active member
Jun 23, 2019
131
55
28
Just to add some info on my recent forwarding adventures too..

I am running Linux on all my main machines (Manjaro on desktop, Ubuntu on Laptop) Which both use GDM/Gnome and of course I ran in to the same issues @mach_kernel experienced. At first I was attempting to run the entire 4dw environment with /usr/lib/X11/Xsession but this was causing all sorts of issues pointed out above. There are a couple of ways to get X11 forwarding going, all with different strengths and weaknesses. I found that if you want to run the entire Irix desktop with icons etc you absolutely need to use an 'xinit' approach and run a seperate X server - but this was not the avenue I wanted to take (so I'm not covering it here) I run a triple monitor setup on my main Linux desktop, ideally I wanted to have access to the Irix file manager 'fm' and the toolchest. I achieved this with:

Code:
ssh -Y -C username@sgiipaddress
-Y meaning open a trusted connection to avoid privacy issues (I had lots of privacy denied issues using -X)
-C meaning compressed network stream to save bandwidth

Then once logged in, simply load: 'toolchest &' 'iconcatalogue &' 'fm &' - you get the gist, using & keeps the terminal window operational.
I then ran into an issue where the file manager would not display, the console output said there was some issue with GLX. So I started searching the net to find out what was going wrong.

With this guide: SCM Guide to X11 Forwarding
I learned that you need 'indirect' rendering to be enabled for some applications, notably the file manager. Must be due to those fancy vector icons.
This particular command shows whether it is enabled on your machine or not:
Code:
glxinfo
export LIBGL_ALWAYS_INDIRECT=1
glxinfo
So, run glxinfo first - you should get a normal opengl driver output with direct rendering. After setting the force indirect variable, try glxinfo again - if it fails you know it is disabled on your system! So now I just needed to learn WHY it was disabled in the first place.
A little bit of searching later I found: Stack Exchange Link

In this article it explains that in all modern X server releases, indirect rendering is disabled! And top it off, GDM doesn't allow you to pass the +iglx variable to X. The work around is to wrap X inside a script that launches the Xserver with +iglx.

Code:
mv /usr/bin/Xorg /usr/bin/Xorg.original
echo -e '#!/usr/bin/env bash\nexec /usr/bin/Xorg.original "$@" +iglx' > /usr/bin/Xorg
chmod +x /usr/bin/Xorg
chcon --type=bin_t /usr/bin/Xorg
Upon checking this on my Ubuntu system (20 LTS) & Manjaro 18 I found that X was already wrapped inside a script, so I did not need to follow the above instructions. The Xorg script in Ubuntu looks for an Xorg.wrap and if it exists it will pass it off to there. If no .wrap exists, it launches Xorg. I simply added +iglx to the end of the code in Ubuntu & Manjaro's Xorg scripts.

Code:
#!/bin/sh
#
# Execute Xorg.wrap if it exists otherwise execute Xorg directly.
# This allows distros to put the suid wrapper in a separate package.

basedir="/usr/lib"
if [ -x "$basedir"/Xorg.wrap ]; then
        exec "$basedir"/Xorg.wrap "$@" +iglx
else
        exec "$basedir"/Xorg "$@" +iglx
fi
Then - after restarting the machine, I logged back in to my SGI with ssh as detailed above, low and behold everything ran perfectly, including the file manager! Hope this helps anyone else ...

Oh and apparently those with Macs should run:
Code:
defaults write org.macosforge.xquartz.X11 enable_iglx -bool true
To enable indirect rendering in XQuartz.

Screenshot_from_2020-12-28_22-22-21.png
 
Last edited:

mgtremaine

Member
May 3, 2020
62
35
18
San Diego, Ca
www.stellarcore.net
Just for the extra details if anyone has jumped to Big Sur (and I believe Catalina also) you might need to define the path to Xauth. While it always worked without this from 10.4 -> 10.14 last week I jumped to Big Sur from Mojave and found I could not X forward without adding the XAuthLocation config.

cat ~/.ssh/config

Host *
XAuthLocation /opt/X11/bin/xauth
ForwardX11Trusted yes
ForwardX11 yes


-Mike
 
Last edited:

stormy

Active member
Jun 23, 2019
131
55
28
Just adding a very good guide on more ways to ensure iglx is enabled on MacOSX: https://www.visitusers.org/index.php?title=Re-enabling_INdirect_glx_on_your_X_server

@mach_kernel it looks fine to me, it's using the same theme I have set on the machine itself

Currently while testing on OS X I'm getting the same issues Mach_kernel and Callahan are getting here:

Seems that this is a very old issue that was present even back in theb OSX Tiger days, might be related to the colour depth, I found this archive:

I found this old post from 2004 with Sun users having the same issue:

After reading this I tried all the different ways of starting Xquartz with and without xinerama - but either way file manager would not load due to the same issues. One thing I noticed is that without xinerama the X windows wouldn't draw an OSX style top bar, interesting :)
 
Last edited:

stormy

Active member
Jun 23, 2019
131
55
28
Another addition:

If you are trying X forwarding on Linux, enabled iglx but seem to be getting a 'core dumped' error from your SGI upon launching 'fm' file manager - you need to install all the xorg font packages from your distributions repo, just search for 'xorg fonts'. The 'xorg fonts misc' package is important.

People often tell you 'the font errors shouldn't be an issue' etc, but in this case they definitely are.
 

LarBob

Administrator
Feb 8, 2019
51
27
18
@mach_kernel
I have opened up an issue with the team over at XQuartz:
Sadly, I doubt you'll have much luck with this. XQuartz doesn't even have a working build system currently (that's publicly released). From what I understand the person responsible for it at Apple has been busy w/ the Apple Silicon transition and life stuff so they haven't had much time to look at it in quite a while. You might have better luck submitting an issue to MacPorts for their xorg-server port, which has the same issue.
 

Irinikus

Well-known member
Dec 16, 2019
738
553
93
South Africa
www.youtube.com
Today I decided to take a look at X forwarding and spent the day messing around trying to remote X from my Tezro to my Mac Pro. (After some communication with @François Deretz in my YouTube comments!)

I kind of got there:



It was educational, but not that useful, as not everything works properly.

That said, it was something different, and it kept me entertained for the day!!! :)

I will explain more on this subject once I properly constitute a proper procedure from all of the messing around I did! (I spent allot of time trying to get the "Authentication" right, without much success!)

The solution in the end was typing the following in the xterm: "ssh -Y user_account@machine_IP_address" The user account that you use must be password protected for it to work and you also have to go through the process of installing and setting up OpenSSH on the SGI side.
 
Last edited:
  • Like
Reactions: Elf

Irinikus

Well-known member
Dec 16, 2019
738
553
93
South Africa
www.youtube.com
I got it up and running with the following command: "Xnest -geometry 1280x900 :1 & DISPLAY=:1 ssh -Y user@system_IP"



There is one caveat though, and that is the fact that you don't seem to be able to move the windows around within the Xnest!

 
  • Like
Reactions: Elf

About us

  • Silicon Graphics User Group (SGUG) is a community for users, developers, and admirers of Silicon Graphics (SGI) products. We aim to be a friendly hobbyist community for discussing all aspects of SGIs, including use, software development, the IRIX Operating System, and troubleshooting, as well as facilitating hardware exchange.

User Menu