ZSystems/GraphicalApplicationsLinuxONE
Using Graphical Applications on a LinuxONE Instance
Rationale: E.g. verifying problems/bugs reported for big endian architectures in general or s390x
specifically. BUT: It is - at least IMHO - not clear how VNC handles endianness when a VNC client is running on a little endian (x86_64
) system and the VNC server on a big endian system. How is that handled on architectures/systems supporting bi-endianness (ARM64; aarch64
or POWER; powerpc64
)? (Educated guess: little endian<->network byte order (big endian)<->big endian; in case the original author's guess is correct, it won't help for verifying the bug - as that would assume a big endian system on the VNC client side. Still, the information is useful, that's why it has been provided.)
Assumption(s): You're running Linux as an OS on your laptop/local PC (though both VNC and SSH clients exist for Windows and macOS, too, of course. With regard the OpenSSH cmd line client, one can safely assume that it's available on/for any POSIX-compliant OS.)
Required components:
- An X server (
Xvfb
, as it's very easy to set up (no further configuration needed) ) - a VNC server (e.g.
x11vnc
) - a standard OpenSSH cmd line client (for setting up the SSH tunnel; on your laptop/local PC)
- a VNC client (e.g.
xtightvnc
; on your laptop/local PC)
Prerequisite(s)
- OpenSSH is installed on both the client and the LinuxONE instance. Furthermore, X11 forwarding must be enabled for both the SSH client (
ssh
; via a snippet containingForwardX11 yes
in$HOME/.ssh/config
) AND the server (sshd
; viaX11Forwarding yes
in/etc/ssh/sshd_config
)!
Not covered in this guide (out of scope):
- General X11/window mgr/desktop environment setup tasks (e.g.
xinitrc
specifically customized forXvfb
(standardxinitrc
"assumes" a "normal" X server - i.e. one that uses a graphic card, not "just" a frame buffer device) - Wayland
Setup/Installation Steps
- LinuxONE instance: Install the following pkgs and start virtual frame buffer X server, followed by the VNC server
sudo zypper in xorg-x11-server-Xvfb x11vnc xauth xeyes
- LinuxONE instance: start
Xvfb
server
Xvfb -shmem -fbdir /var/tmp &
- LinuxONE instance: set your VNC passwd (only necessary if using
x11vnc
for the first time or in case you've deleted your VNC passwd file)
x11vnc -storepasswd
- LinuxONE instance: Optional in case you've used the all-in-one-cmd mentioned below in the alternative step
x11vnc -localhost -usepw -auth ~/.Xauthority
- Local system: alternative to previous step: A simpler "all-in-one" cmd is (mentioned in the
x11vnc
man page; supposed to be executed on the local ystem and afterXvfb
has been started on the LinuxONE instance):
ssh -i ~/.ssh/keys/<path-to-pem-file> ‐t ‐L 5900:localhost:5900 linux1@<linux-one-instance-ip> ’x11vnc ‐localhost -usepw -auth ~/.Xauthority ‐display :0’
The cmd can be simplified further in case you add a snippet for accessing your LinuxONE instance to your ~/.ssh/config
file:
Host <some-name> User linux1 Hostname <ip-of-your-linuxone-instance> ForwardX11 yes IdentityFile ~/.ssh/keys/<key-file-name-without-suffix>.pem
Then, the previous ssh cmd can be shortened to:
ssh ‐t ‐L 5900:localhost:5900 <some-name> ’x11vnc ‐localhost -usepw -auth ~/.Xauthority ‐display :0’
(omitted values will be taken from your ssh config file)
Important log messages to watch out for (x11vnc
has been deliberately started in the foreground for better debuggability):
*** XOpenDisplay of ":0" successful. 30/01/2024 12:29:53 30/01/2024 12:29:53 Using X display :0 30/01/2024 12:29:53 rootwin: 0x50d reswin: 0x100001 dpy: 0x6d57710 [...] 30/01/2024 12:29:53 Default visual ID: 0x21 30/01/2024 12:29:53 Read initial data from X display into framebuffer. 30/01/2024 12:29:53 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/5120 30/01/2024 12:29:53 30/01/2024 12:29:53 X display :0 is 32bpp depth=24 true color 30/01/2024 12:29:53 30/01/2024 12:29:53 Autoprobing TCP port 30/01/2024 12:29:53 Autoprobing selected TCP port 5900 [...] 30/01/2024 12:29:53 screen setup finished. 30/01/2024 12:29:53
The VNC desktop is: opensuseholger:0 PORT=5900
- Local system: Install the following pkgs:
xtightvncviewer
(exact package name may vary depending on your OS)
- Local system: (only in case the previously mentioned all-in-one cmd hasn't been used) Start SSH tunnel (remember to replace placeholders with real values)
ssh -i ~/.ssh/keys/<file-name>.pem -t -L 5900:localhost:5900 linux1@<linuxone-instance-ip-addr>
The hint regarding your local ssh config file given above also applies to this ssh cmd
- Local system: connect using e.g. xtightvncviewer (or some other VNC client) to
localhost:5900
and log in using your VNC (i.e. NOT your regular!) passwd
=> VNC session window with a "plain" X11 root window should appear
Local system: Log messages for xtightvncviewer
should be similar to these:
Connected to RFB server, using protocol version 3.8 Performing standard VNC authentication Authentication successful Desktop name "opensuseholger:0" VNC server default format: 32 bits per pixel. Most significant byte first in each pixel. True colour: max red 255 green 255 blue 255, shift red 16 green 8 blue 0 Using default colormap which is TrueColor. Pixel format: 32 bits per pixel. Least significant byte first in each pixel. True colour: max red 255 green 255 blue 255, shift red 16 green 8 blue 0 Same machine: preferring raw encoding
LinuxONE instance AFTER successful VNC login: log messages (from x11vnc
) should be similar to these:
30/01/2024 12:31:31 Got connection from client ::1 30/01/2024 12:31:31 0 other clients 30/01/2024 12:31:31 Normal socket connection [...] 30/01/2024 12:31:31 incr accepted_client=1 for ::1:37504 sock=10 30/01/2024 12:31:31 Client Protocol Version 3.8 30/01/2024 12:31:31 Protocol version sent 3.8, using 3.8
- LinuxONE instance: set DISPLAY variable to default display
export DISPLAY=:0
- LinuxONE instance: start the graphical application of your choice
baobab &
=> should appear in the root window. Due to missing window mgr decorations (title bar, etc.), the window can't be moved around on the (VNC client) screen (actually, a window; but the window functions a substitute for a real monitor)
NOTE: as NEITHER xinitrc
NOR a window mgr is configured, there are NO window decorations (consequently, windows can't be moved/resized, etc.)! So, in case you start multiple graphical applications, they'll simply overlap and may thus not be visible (and thus also not usable)!
(baobab
is a GTK4-based application intended for providing a graphical overview of how space is distributed across the different (sub)directories on your SSD/hard disk.)
(Alternatively, you can try some really simple application, like xeyes
(the classic X11 application which is used for keeping track of the mouse cursor.) )