Remote desktop sharing should be the same on all of the Ubuntu distributions (package availability may differ between architectures, but if the package is available, then setup should be identical). See:
DISPLAY is an environment variable which matches a running server. Mostly “:0” implies the first local display, “:10” would be a different display. It isn’t mandatory that a server have a particular “:#”, just that to match this is required to display on that server. This is a minimum requirement, there are still issues such as security. For example, using “:0” implies this first server of the local machine, but “192.168.1.2:0” would imply the first server of the remote machine at 192.168.1.2. Security would get in the way unless you went through some setup procedures. Even if you did this, the server still may not connect if TCP remote sharing is required (normally it uses UDP and TCP is disabled). To use a virtual desktop implies matching security, matching DISPLAY, and providing software which uses the correct protocol at each side…a virtual desktop gets around the TCP requirement because it is a substitute for the server itself having that requirement.
Regarding EGL, if you forward X events to the local DISPLAY under “:0”, then it should work if the display has EGL capability and if you are logged in as the same user under something like ssh or local text console as is the X server. When you open a console within X the DISPLAY variable is automatically set, and obviously security allows you to display to your own login. DISPLAY must be manually set if the login and display are not to the same GUI.
Should you set DISPLAY to a server which does not have EGL (and assuming the application requires EGL), then you will get an error. Should you set DISPLAY to a server using a wrong version of EGL, you would also get an error. It seems like “:0” was correct for you, but try testing with programs which are generic in nature and do not have special library requirements. An example would this command: “DISPLAY=:0 xterm”. The “xterm” should open up.
Whenever you talk about opening a graphical program you should state if the user opening the program is logged in to the machine where the program is to be displayed. You should also mention how you are logged in, e.g., a terminal ran the command within the X GUI environment, or a terminal on a non-GUI text console was used after setting DISPLAY, or ssh was used, so on.
Be aware that each server has a different DISPLAY. The native X server would typically be “:0”, probably a virtual server would set something like “:10”. Your user must be logged in to whichever server you want to display to regardless of whether it is real or virtual. When you run a command as a particular user to start an X session (regardless of real or virtual), then that user is the one logged in.