support

About Support Team

This author has not yet filled in any details.
So far Support Team has created 33 blog entries.

Getting 'Gah. Your tab just crashed' from Firefox running in WSL?

Not all Linux GUI apps run in WSL. Some of them are having compatibility issues especially when they depend on background running services (ex. dbus) or require security related features in Linux. Recent versions of Firefox and many other web browsers are having such compatibility issues.

Unlike most regular Linux GUI apps that are developed for a specific task, web browsers can be a platform for running other programs (ex. web apps and plugins developed with JavaScript). Hence web browsers are trying to create a sandbox for safely running those codes and such techniques cause compatibility problems in WSL.

Read more ...
2020-04-16T02:36:04+00:00April 16, 2020|

Firefox tabs are crashing in WSL. Now what?

Not all Linux GUI apps run in WSL. Some of them are having compatibility issues especially when they depend on background running services (ex. dbus) or require security related features in Linux. Recent versions of Firefox and many other web browsers are having such compatibility issues.

Unlike most regular Linux GUI apps that are developed for a specific task, web browsers can be a platform for running other programs (ex. web apps and plugins developed with JavaScript). Hence web browsers are trying to create a sandbox for safely running those codes and such techniques cause compatibility problems in WSL.

Option 1 Wait for updates

Report your problems or share your findings with the developers of WSL and Firefox; let them fix the issues. Upcoming WSL2 also greatly improves compatibility and doesn't seem to have problems running Firefox or other web browsers.

Option 2 Find another web browser

Fortunately, Firefox ESR (Extended Support Release) seems to be compatible with the current WSL. You can download it directly from Firefox website. Firefox ESR doesn't support the latest features available in the current version of Firefox, but it has the latest security and stability fixes.

If you're using Ubuntu/WSL, Ubuntu Mozilla Team also maintains a PPA that can be added to your APT software repositories. The following outlines the procedure for installing Firefox ESR in Ubuntu:

sudo add-apt-repository ppa:mozillateam/ppa
sudo apt update
sudo apt install firefox-esr



Once a 'firefox-esr' package is installed, you can launch it simply by executing firefox-esr:

firefox-esr






Do you want to completely replace the original firefox executable with firefox-esr? You can execute the following commands:

sudo apt purge firefox
sudo ln -s /usr/bin/firefox-esr /usr/bin/firefox



You can now just execute firefox for starting Firefox ESR.

2020-04-16T01:27:51+00:00April 16, 2020|

Setting up Ubuntu (WSL) for Linux GUI Apps

WSL doesn't officially support running Linux GUI apps. Hence when you first install Ubuntu/WSL from the Store, it doesn't include any X Window related libraries or utility programs. For minimal setup, please check the followings:

1 [REQUIRED] DISPLAY environment variable

export DISPLAY=127.0.0.1:0.0



In order for Linux GUI apps to connect to X410, you need to set the DISPLAY environment variable. You can set it just before launching your Linux GUI apps or have it permanently added to your login shell script (~/.bashrc):

echo '[ -z $DISPLAY ] && export DISPLAY=127.0.0.1:0.0' >> ~/.bashrc



Instead of always setting the DISPLAY environment variable to '127.0.0.1:0.0', the above command adds a line to '~/.bashrc' that sets the value only when it's not already assigned (-z). Such safeguard can be important for some servers that automatically set the DISPLAY environment variable when you log in. For example, if you're planning on running an SSH server in WSL and forward X11 Linux GUI apps, you must not overwrite the DISPLAY environment variable set by the server (ex. localhost:10.0).

After executing the above command, open a new Ubuntu/WSL console and run the following command to see if the DISPLAY environment variable is set correctly:

echo $DISPLAY



Please note that X410 also supports changing its display number with a command-line argument. In such case, you need to adjust the DISPLAY environment variable accordingly. For example, if you've set the display number to '1', you need to change the last part of the DISPLAY environment variable from ":0.0" to ":1.0". If you're using multiple WSL distros, you can use this feature to concurrently run separate GUI desktops for each one.

Are you using WSL2? Unlike WSL1, WSL2 has its own isolated network similar to Hyper-V virtual machines and you need to dynamically extract an address for connecting back to X410. More detailed information is found here.

2 [OPTIONAL] dbus-launch

Many Linux GUI apps use the D-Bus for inter-process communication (IPC). In order to check if it's properly installed, try running the following commands after launching X410 (if your version of 'dbus-launch' doesn't support the "--exit-with-x11" option, you can also try "--exit-with-session" option):

export DISPLAY=127.0.0.1:0.0
dbus-launch --exit-with-x11




If you're getting a "command not found" error, install the 'dbus-x11' package:

sudo apt install dbus-x11



If you're getting the following error:

Session lifetime based on X11 requested, but machine UUID unavailable: D-Bus library appears to be incorrectly set up: see the manual page for dbus-uuidgen to correct this issue. (Failed to open "/var/lib/dbus/machine-id": No such file or directory; UUID file '/etc/machine-id' should contain a hex string of length 32, not length 0, with no other text).

execute this command:

sudo dbus-uuidgen --ensure




When you launch a Linux GUI desktop environment such as Xfce4, you don't need to worry about 'dbus-launch'. However, if you're launching a Linux GUI app directly and getting errors about 'dbus-daemon', try running the 'dbus-launch' as mentioned above before launching your Linux GUI app. If it works, you can permanently add it to your batch file or script (ex. Opening a genuine Linux terminal emulator (WSL) directly from Windows File Explorer).

3 [OPTIONAL] Screen savers and lockers

Screen savers and lockers are one of those essentials if you're running Linux as the main OS for your system. But WSL lives within Windows and such executables are not needed. In fact those screen savers and lockers interfere with Windows components that can actually access hardware and do the real screen and power saving.

So if you notice screen savers and/or lockers are installed, we highly recommend removing them instead of just disabling them. For example, while installing the Xfce4 package in Ubuntu, it automatically installs 'xscreensaver' and adds a 'Screensaver' settings shortcut. You can remove them by executing the following command:

sudo apt purge xscreensaver gnome-screensaver


Removing those packages also automatically removes the shortcut. You can execute the following command to remove some of the popular screen savers and lockers for Ubuntu:

sudo apt purge xscreensaver gnome-screensaver light-locker i3lock



In case you forgot about the screen locker and get a black screen, don't panic! You can 'kill' the locker and get back to your desktop by using the 'ps' and 'kill' command from another Ubuntu/WSL console.

You're now ready to run your Linux GUI apps! Just make sure X410 is running before launching them.

2020-04-03T10:36:21+00:00April 3, 2020|

X410.dev is now live! See how you can seamlessly use Linux GUI apps in Windows 10 with X410!

We'll be using X410.dev as a dedicated website for all X410 related contents. Currently available how-to guides and posts about X410 at Token2Shell.com will be moved to this new website as well.

X410.dev will also host other topics that focus on creating a work environment that seamlessly combines Windows and Linux/Unix-like operating systems. When we decide to release new apps or tools for helping such efforts, you'll definitely hear about it first from X410.dev.

We hope you like the new website!

2020-03-06T14:03:27+00:00March 5, 2020|

Quick Testing VSOCK (Hyper-V) Support in X410

INGREDIENTS

X410 supports traditional methods such as SSH X11 forwarding and direct TCP/IP networking for accepting connections from Linux GUI apps running in virtual machines. So, if you already have a Linux virtual machine in Hyper-V, you can seamlessly use its GUI apps alongside with Windows apps via X410.

However, when using SSH X11 forwarding, you're adding unnecessary overhead of encrypting communication data, not to mention the extra workload and resources required for maintaining the SSH connections themselves. If you use the direct TCP/IP networking, you can avoid the encryption and other overheads, but since you need to allow public access for Windows host, there can be security issues. Without this public access, Linux GUI apps in your virtual machine cannot connect back to X410 running in Windows host. You may also have connection restoring problems after waking up from sleep mode; connections made from Linux GUI apps to X410 get severed after waking up, but the Linux GUI apps think those connections are still alive and active.

X410 also supports communicating with Hyper-V virtual machines via VSOCK (virtual socket). VSOCK doesn't rely on TCP/IP networking and it's only used for communicating between Windows host and virtual machines running within that host. Hence you don't need to make any change to firewall or security related settings in Windows; no public access required! You can also avoid other overheads and issues such as the encryption and the sleep mode problem mentioned above.

The following shows quick steps for test driving the VSOCK with X410. If you want to fully replace your Linux GUI desktop on Hyper-V console with X410, additional information is found in "Using X410 with Hyper-V Linux Virtual Machines via VSOCK".

X410 + VSOCK

PROSCONS
  • Less workload for virtual machines; no need to run X-Window or XRDP server within a virtual machine
  • Seamlessly share clipboard with Windows apps
  • No need to change any firewall or security setting
  • Avoid TCP/IP network restoration problems after waking up from sleep mode
  • Need to add entries in Windows registry for mapping VSOCK ports
  • Need a data relay server running in virtual machines

Windows 10

X410 runs in a secure sandbox and it cannot directly modify Windows registry. Hence you need to manually make the changes in Windows registry as described below.

In order to have X410 communicate with Hyper-V virtual machines via VSOCK, you first need to add a Windows registry key under 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\GuestCommunicationServices'. The new registry key must be in the following format:

<portnumber>-facb-11e6-bd58-64006a7986d3



<portnumber> is derived from the display number set for X410. If it's set to be '0', <portnumber> must be '6000 + 0 (= display number)' in 4-byte hexadecimal format; 00001770. Hence the new registry key becomes '00001770-facb-11e6-bd58-64006a7986d3'. For the display number 1, it becomes '00001771-facb-11e6-bd58-64006a7986d3' and so forth.

Under the new registry key, you also need to add the following string value for a friendly name that describes what the key is used for:

"ElementName"="X410 Display 0"







Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\GuestCommunicationServices\00001770-facb-11e6-bd58-64006a7986d3]
"ElementName"="X410 Display 0"




You can also download one of the following registry files for adding the entries mentioned above. You can import it from 'Registry Editor (regedit.exe)' in Windows.

DONE

In order to enable the VSOCK feature in X410, you need to launch X410 with a command line switch '/listen hyperv'. You can use command-line switches directly from Windows Start menu, Windows Command Prompt or PowerShell.

x410 /listen hyperv /wm








When the Hyper-V (VSOCK) option is properly enabled, X410 adds a '+hyperv' text label to its tray icon tooltip.

DONE

Hyper-V Linux Virtual Machine

We're assuming you already have a Hyper-V Linux virtual machine. If you don't have one, try the quick method that was newly added in Windows 10 Fall Creators Update (Windows 10 version 1709); 'Hyper-V Quick Create'.

In this guide, we're showing command-line examples for Ubuntu. However, you shouldn't have any problem applying the same procedure for other Linux distributions; you just might need to adjust the commands for installing programs (ex. 'sudo pacman -S socat' for installing socat in Arch Linux).

In order for our VSOCK method to work, you need to make sure 'hv_sock' Linux module is installed on your virtual machine. For checking the installed modules, you can use 'lsmod' command.

If you cannot find 'hv_sock', you should be able to install it by using the following commands.

sudo sh -c 'echo "hv_sock" > /etc/modules-load.d/hv_sock.conf'
sudo reboot



Please also check the version of your Linux and make sure its version is 4.14 or higher. Hyper-V (hv_sock) is supported since Linux 4.14.

DONE

Although X410 can be directly connected via VSOCK from Hyper-V Linux virtual machines, X-Window apps and tools are not built for VSOCK; we need an intermediate data relay server that can be seen as an X-Window server for those programs.

In this example, we're using a popular utility program called 'socat'. socat is used in order to simply demonstrate the possibility of using VSOCK; it's definitely not used for its performance.

sudo apt update && sudo apt install socat



You can then execute the following command to create a virtual X-Window server that forwards data to and from X410.

socat -b65536 UNIX-LISTEN:/tmp/.X11-unix/X5,fork,mode=777 SOCKET-CONNECT:40:0:x0000x70170000x02000000x00000000 &



Please note that the above command creates a server at display number '5'. So you should set the DISPLAY environment variable as the following in order to have X-Window apps use this server:

export DISPLAY=:5.0



Please also note that we're using a display number '5' instead of '0'. It can be any number, but '0' is already used by the Linux GUI desktop running on Hyper-V console. Before assigning a display number, check '/tmp/.X11-unix/' folder and just make sure your display number is not already in use (X<display-number>; X0, X10 and etc.).

DONE

You're now ready to start Linux GUI apps and open them on Windows via X410. Please note that instead of using the 'export' command shown above, you should also be able to use a command-line switch for most Linux GUI apps (ex. firefox --display :5.0).

Please also note that some Linux GUI apps have a main hidden background program that manages its visible instances (ex. GNOME Terminal, FireFox and etc.). For such programs, you may not be able to start a new instance for a display number that is different from its first instance. For example, when you already have a FireFox opened on your Hyper-V console, you cannot open another FireFox on Windows via X410; you first need to close the FireFox on Hyper-V console.

DONE
2020-03-24T07:20:10+00:00March 5, 2020|

Using X410 with Hyper-V Linux Virtual Machines via VSOCK

INGREDIENTS

Starting from version 2.6.0, X410 can be used with Hyper-V Linux virtual machines for opening their GUI desktop via VSOCK (virtual socket).

By using VSOCK, you don't need to worry about configuring firewall or IP address. As X410 seamlessly supports Windowed Apps mode and shared clipboard, you can also use Linux GUI apps side by side with Windows apps instead of confining them to a Hyper-V console. Moreover, your virtual machines will be using less system resources since you don't need to run XRDP or other GUI desktop separately for each Linux virtual machine.

PREPARATION:
Hyper-V Linux Virtual Machine

There are various ways to create a virtual machine in Hyper-V such as using the new feature added in Windows 10 Fall Creators Update (Windows 10 version 1709); 'Hyper-V Quick Create'.

You should be able to use any recent Linux distribution as long as it's supported in Hyper-V. However, we'll be using Ubuntu in this example. After creating your Ubuntu virtual machine, check its installed Linux modules and make sure 'hv_sock' is installed. For checking the installed modules, you can use 'lsmod' command.

If you cannot find 'hv_sock', you should be able to install it by using the following commands.

sudo sh -c 'echo "hv_sock" > /etc/modules-load.d/hv_sock.conf'
sudo reboot



Please also check the version of your Linux and make sure its version is 4.14 or higher. Hyper-V (hv_sock) is supported since Linux 4.14.

DONE

We'll be using X410 instead of Hyper-V console for Ubuntu GUI desktop. The following commands will turn off the XRDP graphical login and enable a text only mode for the console.

sudo apt purge xrdp
sudo systemctl set-default multi-user.target
sudo reboot







It's difficult to work with files in text mode over Hyper-V console. Instead of using the console, you should install an OpenSSH server and change the settings and files via an SSH client. Windows 10 has a built-in SSH client that can readily be used from PowerShell or Windows Command Prompt.

sudo apt install openssh-server



For finding out the IP address assigned to your Ubuntu virtual machine, you can use 'ip' command with 'address' as its argument.

If you want to re-enable the graphic mode, you can use the following commands. If you also want to bring back the XRDP graphical login for the 'Enhanced Session' feature in Hyper-V, you need to re-install 'xrdp'.

sudo apt install xrdp
sudo systemctl set-default graphical.target
sudo reboot



DONE

PREPARATION:
Windows 10

X410 runs in a secure sandbox and it cannot directly modify Windows registry. Hence you need to manually make the changes in Windows registry as described below.

In order to have X410 communicate with Hyper-V virtual machines via VSOCK, you first need to add a Windows registry key under 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\GuestCommunicationServices'. The new registry key must be in the following format:

<portnumber>-facb-11e6-bd58-64006a7986d3



<portnumber> is derived from the display number set for X410. If it's set to be '0', <portnumber> must be '6000 + 0 (= display number)' in 4-byte hexadecimal format; 00001770. Hence the new registry key becomes '00001770-facb-11e6-bd58-64006a7986d3'. For the display number 1, it becomes '00001771-facb-11e6-bd58-64006a7986d3' and so forth.

Under the new registry key, you also need to add the following string value for a friendly name that describes what the key is used for:

"ElementName"="X410 Display 0"







Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\GuestCommunicationServices\00001770-facb-11e6-bd58-64006a7986d3]
"ElementName"="X410 Display 0"




You can also download one of the following registry files for adding the entries mentioned above. You can import it from 'Registry Editor (regedit.exe)' in Windows.

DONE
x410 /listen hyperv /desktop



When the Hyper-V option is properly enabled, X410 adds a '+hyperv' text label to its window title.

DONE

TEST DRIVING:
Ubuntu Virtual Machine

Although X410 can be directly connected via VSOCK from Hyper-V Linux virtual machines, X-Window apps and tools are not built for VSOCK; we need an intermediate data relay server that can be seen as an X-Window server for those programs.

In this example, we're using a popular utility program called 'socat'.

sudo apt update && sudo apt install socat



You can then execute the following command to create a virtual X-Window server that forwards data to and from X410.

socat -b65536 UNIX-LISTEN:/tmp/.X11-unix/X0,fork,mode=777 SOCKET-CONNECT:40:0:x0000x70170000x02000000x00000000 &



Please note that the above command creates a server at display number '0'. So you should set the DISPLAY environment variable as the following in order to have X-Window apps use this server:

export DISPLAY=:0.0



If you've launched X410 for a different display number, you need to adjust the 'socat' command shown above accordingly. For example, if X410 is set for display number '1', you just need to change 'x70170000' to 'x71170000'. This value is derived from '6000 (base port number) + 1 (= display number)'; hexadecimal format (0x00001771) in little-endian byte order.

'socat' is used in this example in order to simply demonstrate the possibility of using VSOCK; it's definitely not used for its performance. We'll update this article soon with better tools for setting up a virtual X-Window server.

DONE

For a quick test, try launching 'xclock':

xclock



If 'socat' is working properly, you should see xclock running in X410. Once confirmed, you can terminate xclock by pressing CTRL+C from your text console.

Now, let's create a script file that starts Ubuntu desktop.

sudo vi /usr/bin/start-ubuntu-desktop.sh



In the script file, enter the following lines:

#!/bin/bash

export XDG_SESSION_TYPE=x11
export XDG_CURRENT_DESKTOP="ubuntu:GNOME"
export GNOME_SHELL_SESSION_MODE=ubuntu

exec gnome-session --session=ubuntu




Once you finish entering the above lines, save and close the file. Since you want to run the script file, don't forget to add an 'execute' permission to the file:

sudo chmod +x /usr/bin/start-ubuntu-desktop.sh



DONE
start-ubuntu-desktop.sh


Please be patient! It may take 30+ seconds depending on your computer hardware before you see Ubuntu desktop on X410.

DONE

TIDYING-UP:
Directly Booting Ubuntu Desktop onto X410

You can automatically open Ubuntu desktop on X410 when you simply start your Ubuntu virtual machine. You can do this by creating startup services as described below.

The method shown in Step 3.2 can be created into a service unit and have it automatically loaded when Ubuntu boots up.

sudo vi /etc/systemd/system/x410vsock.service



[Unit]
Description=X410 VSOCK Service
After=network.target

[Service]
User=root
Restart=always
Type=simple
ExecStart=/usr/bin/socat -b65536 UNIX-LISTEN:/tmp/.X11-unix/X0,fork,mode=777 SOCKET-CONNECT:40:0:x0000x70170000x02000000x00000000

[Install]
WantedBy=multi-user.target




DONE

We're using /sbin/agetty in this service unit for automatically logging into a virtual terminal. During its login process, a startup shell script also then automatically launches an Ubuntu GUI desktop that makes use of the X-Window data relay server created in Step 4.1. An example of such startup script is shown in the next Step 4.3.

sudo vi /etc/systemd/system/x410tty.service



[Unit]
Description=X410 Autologin Service
After=network.target x410vsock.service

[Service]
User=root
Restart=always
Type=simple
ExecStart=-/sbin/agetty --autologin your_login_account --noclear tty2 $TERM

[Install]
WantedBy=multi-user.target



Please make sure to change the 'ExecStart=-/sbin/agetty --autologin your_login_account --noclear tty2 $TERM' line with your user account; replace the 'your_login_account' with your user ID.

DONE

If you're using Bash as your login shell, add the following lines to '~/.profile'. '~/.profile' is a file that is automatically executed when you log in.

if [[ ! $DISPLAY && -S "/tmp/.X11-unix/X0" ]]; then
    export DISPLAY=:0.0
    if [[ $XDG_VTNR -eq 2 ]]; then
        exec /usr/bin/start-ubuntu-desktop.sh
    fi
fi




The service file created in Step 4.1 acquires a virtual terminal as tty2. Hence $XDG_VTNR -eq 2 checks the value '2'. If you're using tty3, it should be $XDG_VTNR -eq 3 and so forth.

Please also note that the commands shown above automatically set the DISPLAY environment variable if a Unix domain socket is available for X-Window apps. Hence, if you're connecting locally to this Ubuntu virtual machine via an SSH client, you don't need to activate the SSH X11 forwarding; X-Window apps will be automatically displayed on X410.

DONE

You can start or stop the newly created services in Step 4.1 and 4.2 by using the following command.

sudo service x410vsock start|stop|restart
sudo service x410tty start|stop|restart




But in order to have the new services automatically started when Ubuntu is booting up, you need to use the following commands:

sudo systemctl enable x410vsock.service
sudo systemctl enable x410tty.service




Now try rebooting your Ubuntu virtual machine while X410 is launched with '/listen hyperv' command-line argument. Ubuntu desktop should be automatically shown on X410 within a minute (it takes a bit longer than you would expect).

sudo reboot



DONE

TIDYING-UP:
Launching X410 and Ubuntu VM from a Batch File

The simplest way we recommend for starting your virtual machine from a batch file is using Windows built-in 'hvc.exe' command. However, 'hvc.exe' requires 'administrator' privileges; you cannot use it from a normal batch file. To workaround this problem, you can add your account to 'Hyper-V Administrators' group in Windows; [ Windows Start (right-click) ] » [ Computer Management ] » [ Local Users and Groups ] » [ Groups ] » [ Hyper-V Administrators ]. After adding your account, you need to reboot Windows for the changes to take effect.

If you don't want to make changes to the 'Hyper-V Administrators' group, you need to create a shortcut for your batch file and enable its 'Run as administrator' option.

DONE
start-ubuntu-vm.bat
start x410.exe /desktop /listen hyperv
hvc.exe start "Ubuntu 19.04"



You can now directly start your Hyper-V Ubuntu virtual machine and open its GUI desktop on X410 simply by double-clicking the newly created batch file!

DONE

TIPS AND TRICKS

  • Running X410 in Windowed Apps mode

    Instead of running a full Ubuntu desktop, you can run Linux GUI apps individually and use them side by side with Windows apps. You can accomplish this by first starting X410 in 'Windowed Apps' mode:

    start x410.exe /wm /listen hyperv
    
    
    
    
    
    

    You also need to change the script created in Step 3.3; you should add a command for starting a GUI terminal. Any Linux GUI app that is executed from this terminal will be opened as a separate floating window that can be placed among Windows apps.

    start-ubuntu-desktop.sh
    #!/bin/bash
    
    export XDG_SESSION_TYPE=x11
    export XDG_CURRENT_DESKTOP="ubuntu:GNOME"
    export GNOME_SHELL_SESSION_MODE=ubuntu
    
    gnome-session --session=ubuntu & 
    gnome-terminal & /usr/lib/gnome-terminal/gnome-terminal-server
    
    
    
    
    

    When adding a terminal or any GUI app, make sure the main script keeps running while your added programs are active. The service unit created in Step 4.2 gets automatically restarted when its target (i.e., a virtual terminal acquired via /sbin/agetty) is terminated. So, for the above script, we added a workaround for preventing its immediate exit; 'gnome-terminal' returns even when it's still active, but 'gnome-terminal-server' remains running if there is any instance of 'gnome-terminal'.

    If you don't want to use a workaround, you can use a straightforward GUI terminal such as Xterm. You can also try adapting the Xfce launcher method as shown in 'Get your sidekick for easily managing and launching Linux GUI apps (WSL)'.

  • Xfce

    Running Ubuntu desktop in X410 via VSOCK should give you better rendering performance than the default Hyper-V console. However, if you want faster and snappier user experience, try using Xfce desktop.

  • Running Ubuntu desktop in WSL1

    The script created in Step 3.3 (/usr/bin/start-ubuntu-desktop.sh) can also be used for Ubuntu/WSL1 and start the same Ubuntu desktop on X410 without any change after installing 'ubuntu-desktop' package; sudo apt install ubuntu-desktop. Before executing the script, you just need to make sure dbus service is running; sudo service dbus restart, and the DISPLAY environment variable is pointing to '127.0.0.1:0.0' instead of ':0.0'; export DISPLAY=127.0.0.1:0.0.

    However, it seems Ubuntu desktop uses various services and components that are not fully compatible with WSL1. Hence, unfortunately, Ubuntu desktop in WSL1 is not as stable as in Hyper-V.

  • X410 with WSL2

    WSL2 is based on virtualization technology similar to Hyper-V. So it should provide much better performance and stability for Linux GUI apps including Ubuntu desktop. However, currently available versions (Windows 10 build 18917 and others) don't seem to support VSOCK or shared loopback network that can be utilized to internally and efficiently communicate with X410 (Using X410 with WSL2).

    We should wait a bit longer for it to mature and properly support the same handy features that are already available in WSL1. Moreover, we hope the interop features for Unix domain sockets are improved soon and allow Windows apps such as X410 to communicate directly with Linux apps just by creating a symbolic link in WSL to a Unix domain socket created in Windows. It's already partially supported but it cannot be used with X-Window apps as they call 'setsockopt' function to adjust the size of their buffers before making connections; such behavior breaks the interop requirements. However, this usage pattern is common (i.e., create a socket » adjust its buffer size with setsockopt » connect/bind) for many Linux apps and if it's supported, servers running in Windows should be able to directly service the apps running in WSL without making any modification to those apps.

2020-03-24T07:24:23+00:00March 5, 2020|

Command-Line Switches

X410 can also be launched from Windows Command Prompt by using its execution alias; x410.exe. You don't have to worry about its file path; Windows 10 automatically locates and runs X410.

If you're using Windows 10 April 2018 Update (Version 1803), you can also manage execution aliases from Windows Settings » Apps » Apps & features » "Manage app execution aliases".

X410 currently supports the following command-line switches and you can use them to create batch files that can automatically launch X410 before starting your Linux GUI app or desktop (ex. Creating a Windows Shortcut for Linux GUI Desktop).

x410.exe [:displaynumber] [/desktop|/wm] [/loopback|/public] [/listen hyperv]
:displaynumber displaynumber is a numerical value for designating a display. You can concurrently run X410 for each display number and maintain separate settings. For example, if you want to start X410 for display number 1, you can use the following command from PowerShell or Windows Command Prompt:
x410.exe :1
NEW IN VERSION 2.6.0
/desktop Launch X410 in Desktop mode. If X410 is already running in a different mode, it will be shutdown and restarted in Desktop mode.
/wm Launch X410 in Windowed Apps mode. If X410 is already running in a different mode, it will be shutdown and restarted in Windowed Apps mode.
/loopback Disable public access to X410. Only loopback addresses (ex. 127.0.0.1) can be used for connecting to X410.
NEW IN VERSION 2.5.0
/public Enable public access to X410. You can use any address available to the computer where X410 is running for the DISPLAY environment variable. This mode can be used for forwarding X-Window apps from virtual machines or trusted remote computers. Since any app can connect to X410 in this mode, please use Windows Firewall to properly limit hosts that can access X410.
NEW IN VERSION 2.5.0
/listen hyperv Enable accepting connections from Hyper-V virtual machines via VSOCK. For an example of using this switch, please read the following post:
NEW IN VERSION 2.6.0
2020-03-05T03:44:01+00:00March 5, 2020|

Using X410 with WSL2

Unlike WSL1, you cannot use 127.0.0.1 or localhost to connect back to Windows; when you start WSL2, it gets its own IP address and behaves like a Hyper-V virtual machine. Microsoft seems to be working on changing this behavior and support shared loopback addresses just like WSL1 but it's not yet happened.

Anyhow, if you don't want to wait for the official release of WSL2 or support for the shared loopback addresses, you can make the following changes and use Linux GUI apps in WSL2 with X410.

  • Enable 'Allow Public Access' option in X410

    When you first install X410, it only allows connections from loopback addresses such as 127.0.0.1 for security reasons. But WSL2 is started with its own IP address and behaves like a virtual machine in a separate network. So if you want to have Linux GUI apps in WSL2 show up on Windows, you first need to allow connections from any device including WSL2 for X410. This option is found in [ X410 Tray-icon Popup Menu ] » [ Allow Public Access ].

    When you enable this option for the first time, you'll see a 'Windows Security Alert' popup window for your confirmation about allowing X410 to accept connections from public network. You need to allow this 'Public' access in order to have Linux GUI apps in WSL2 communicate with X410 running in Windows.

    For your information, you may see a similar 'Windows Security Alert' popup window again when X410 is updated to a new version; it seems Windows Firewall treats each executable version separately even though they all belong to the same Microsoft Store app. Such behavior also leaves multiple 'x410.exe' entries in Windows Firewall; you can safely remove those 'x410.exe' entries from previous versions.

    Please also check Windows Firewall settings and make sure X410 is allowed for 'Public' access.

    If you're concerned about security risks for allowing such public access, you can configure Windows Firewall and allow connections to X410 only from WSL2. Please consult Windows Firewall documentation for additional information.

  • Update DISPLAY environment variable

    WSL2 has its own IP address and doesn't yet share loopback addresses; when you're connecting to 127.0.0.1, you're actually connecting to WSL2 rather than the underlying Windows. So you need to directly use the IP address assigned for Windows.

    We recommend using the internal IP address that is automatically added to '/etc/resolv.conf' file in WSL2. This address may get changed periodically. So you should dynamically extract an address from the file when assigning it to the DISPLAY environment variable:

    export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0
    
    
    
    

How do I check if my WSL2 is ready for X410?

As mentioned above, the current version of WSL2 runs in an isolated network. So you need to make sure any program running in WSL2 can make connections back to Windows where X410 is running on. If you can confirm one program successfully making such connections, other Linux GUI apps should also be able to make use of X410.

If you're familiar with 'nc (netcat)' command, you can use it for testing the connections between Windows and WSL2 without actually running a Linux GUI app.

  1. Get the IP address of Windows

    You should already have set the DISPLAY environment variable as mentioned above. This variable contains the IP address that is used by Linux GUI apps for connecting back to X410 in Windows.

    echo $DISPLAY
    
    
    
  2. Run 'nc'

    Let's assume the IP address revealed in Step 1 is '172.30.32.1'. Execute the following command while X410 is running:

    nc -v 172.30.32.1 6000
    
    
    
    

    You should get the following message if X410 can be connected and ready for WSL2:

    Connection to 172.30.32.1 6000 port [tcp/x11] succeeded!

    If you're getting the following, there is a problem with Windows network and/or firewall settings. Please review the settings mentioned above again and make sure they're properly configured. Also, if you're using third-party security software, make sure WSL2 and X410 are not blocked or quarantined.

    nc: connect to 172.30.32.1 port 6000 (tcp) failed: Connection refused

Please keep in mind that WSL2 is in its 'preview' stage and it's only available for an 'Insider' version of Windows. So there can be problems and corrupted settings while updating apps and Windows. Such problems may automatically be fixed in the next Insider version or by simply uninstalling-rebooting-reinstalling X410.

Did Linux GUI apps stopped working after waking up from Windows sleep mode?

WSL2 seems to have inherited this problem from Hyper-V. You can avoid this issue in Hyper-V by using VSOCK. But, unfortunately, WSL2 doesn't yet support VSOCK or other methods that can be used for avoiding this problem. We'll update this page as soon as we find a workaround or when Microsoft fixes it! Stay tuned.

2020-03-24T06:59:13+00:00March 4, 2020|

X410 gets more options for better user experience in Linux GUI apps and desktops

2.8.0
  • You now have an option for updating the content of a window while you're resizing it in Windowed Apps mode. Please note that we recommend turning this feature off when your computer doesn't have enough processing power or network speed.

  • Windows key can now be forwarded to Linux GUI desktops
  • Fixed adding random NULL bytes when copying text from Windows to Linux GUI apps via clipboard
2020-03-12T15:03:50+00:00November 21, 2019|