How to Install Xsrv on Fedora CoreOS Latest

Xsrv is an X server that runs on Microsoft Windows, created by Colin Harrison. Fedora CoreOS is a minimal operating system designed for running containerized workloads. In this tutorial, you will learn how to install Xsrv on Fedora CoreOS Latest.

Prerequisites

To follow this tutorial, you will need:

Steps

  1. Open a terminal on Fedora CoreOS Latest.

  2. Check if X11 forwarding is enabled by running the following command:

    $ echo $DISPLAY
    

    If the command outputs nothing or an error message, X11 forwarding is not enabled. You can enable X11 forwarding by setting the DISPLAY environment variable to the IP address of your Windows machine, followed by :0.

  3. Install the necessary packages by running the following command:

    $ sudo rpm-ostree install xorg-x11-server-Xorg xinit x11-utils x11-apps
    
  4. Configure Xorg by creating a file called 20-xorg.conf in the /etc/X11/xorg.conf.d/ directory with the following content:

    Section "Device"
       Identifier "VGA"
       Driver "modesetting"
       Option "AccelMethod" "none"
    EndSection
    

    This configuration disables graphics acceleration for improved compatibility with X11 clients.

  5. Create a shell script called run.sh in your home directory with the following content:

    #!/bin/sh
    exec xinit -- /usr/bin/Xorg :0 -listen tcp vt$XDG_VTNR
    

    This script starts Xorg on display :0 and listens on TCP/IP port 6000.

  6. Make the shell script executable by running the following command:

    $ chmod +x run.sh
    
  7. Open Xsrv on your Windows machine.

  8. Set the display to the IP address of your Fedora CoreOS machine, followed by :0. For example, if your Fedora CoreOS machine has IP address 192.168.1.100, enter 192.168.1.100:0 into the "Display Number" field.

  9. Start Xorg by running the following command in the terminal on your Fedora CoreOS machine:

    $ ./run.sh
    

    This will start Xorg and wait for X11 clients to connect.

  10. Test Xsrv by running an X11 client such as xeyes:

$ xeyes &

This should open a window with a pair of eyes that follow your mouse cursor.

Conclusion

Congratulations, you have successfully installed Xsrv on Fedora CoreOS Latest! You can now run X11 clients on your Fedora CoreOS machine and display them on your Windows machine using Xsrv.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!