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:
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.