We have installed GEANT4 on a virtual machine using Google Cloud Services. The computations are working. But, unlike running GEANT4 on the local machine, we can’t visualize the simulations as we can on the local machine. Can we simulate what is computed remotely on the virtual machine on our local machine as if both the computation and visualization are local?
_Geant4 Version:_11.2.2
_Operating System:_SMP Debian 4.19.316-1 (2024-06-25) x86_64 GNU/Linux
_Compiler/Version:_gcc (Debian 8.3.0-6) 8.3.0
_CMake Version:_3.24.3
bmorgan
November 24, 2024, 5:46pm
2
It’s better to outline the question in the description rather than the post title.
What exactly do you want to do here - is the VM on your local machine, or on a remote system? If the latter, how are you logging into the machine - ssh
or some other mechanism? What OS are you running locally, and what’s the VM running?
The VM is on a remote system. We are using -ssh. The OS that we are running locally is Windows 10. Our remote system is Linux. We are using VS Code.
bmorgan
November 25, 2024, 10:57am
4
Thanks! It’s not something I’ve done myself, but this should be possible in principle through X11 forwarding. There’s an old, but still I think relevant ticket here:
opened 11:08PM - 04 Mar 21 UTC
closed 03:51PM - 30 Aug 22 UTC
bug
ssh
- VSCode Version: 1.54.0-insider (42e27fe5)
- Local OS Version: Windows_NT x64 … 10.0.16299
- Remote OS Version: Red Hat Enterprise Linux Workstation release 7.9 (Maipo)
- Remote Extension/Connection Type: SSH
---
#### Steps to Reproduce:
1. Start Xming server on local Windows 10 OS.
2. Configure an `.ssh/config` file as such:
```
Host test-machine
User <username>
HostName <hostname>
ForwardX11 yes
```
3. Run VSCode command "*Remote-SSH: Connect to host...*" and choose `test-machine` (remote Linux host).
4. Wait for new VSCode window to launch and integrated terminal to open.
5. Run a test program in the integrated terminal:
```
$ glxgears
Error: couldn't open display (null)
```
6. Check value of `DISPLAY` variable:
```
$ echo $DISPLAY
```
---
#### Output log from *Remote-SSH* channel:
<details>
<summary>Click to expand</summary>
```
[17:43:58.783] Log Level: 2
[17:43:58.793] remote-ssh@0.65.0
[17:43:58.793] win32 x64
[17:43:58.794] SSH Resolver called for "ssh-remote+test-machine", attempt 1
[17:43:58.794] "remote.SSH.useLocalServer": false
[17:43:58.794] "remote.SSH.showLoginTerminal": false
[17:43:58.794] "remote.SSH.remotePlatform": {"test-machine":"linux"}
[17:43:58.795] "remote.SSH.sshPath": undefined
[17:43:58.795] "remote.SSH.sshConfigurationFile": undefined
[17:43:58.795] "remote.SSH.useFlock": true
[17:43:58.795] "remote.SSH.lockfilesInTmp": false
[17:43:58.795] "remote.SSH.localServerDownload": auto
[17:43:58.795] "remote.SSH.remoteServerListenOnSocket": false
[17:43:58.795] "remote.SSH.showLoginTerminal": false
[17:43:58.796] "remote.SSH.defaultExtensions": []
[17:43:58.796] SSH Resolver called for host: test-machine
[17:43:58.796] Setting up SSH remote "test-machine"
[17:43:58.815] Using commit id "42e27fe5cdc58539dad9867970326a297eb8cacf" and quality "insider" for server
[17:43:58.819] Install and start server if needed
[17:44:00.722] Checking ssh with "ssh -V"
[17:44:01.182] > OpenSSH_8.0p1, OpenSSL 1.1.1c 28 May 2019
[17:44:01.188] Running script with connection command: ssh -T -D 51498 "test-machine" bash
[17:44:01.191] Terminal shell path: C:\windows\System32\cmd.exe
[17:44:01.366] >
[17:44:01.367] Got some output, clearing connection timeout
[17:44:02.050] >
[17:44:02.522] > 30ab31aac300: running
>
[17:44:02.583] > Acquiring lock on /home/<user>/.vscode-server-insiders/bin/42e27fe5cdc58539dad9
> 867970326a297eb8cacf/vscode-remote-lock.<user>.42e27fe5cdc58539dad9867970326a29
> 7eb8cacf
> Found existing installation at /home/<user>/.vscode-server-insiders/bin/42e27fe
> 5cdc58539dad9867970326a297eb8cacf...
> Checking /home/<user>/.vscode-server-insiders/.42e27fe5cdc58539dad9867970326a29
> 7eb8cacf.log and /home/<user>/.vscode-server-insiders/.42e27fe5cdc58539dad98679
> 70326a297eb8cacf.pid for a running server
> Looking for server with pid: 16023
>
[17:44:02.607] > Found running server...
>
> *
> * Reminder: You may only use this software with Visual Studio family products,
> * as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
> *
>
> Checking server status on port 39445 with wget
> 30ab31aac300: start
> SSH_AUTH_SOCK====
> DISPLAY====
>
[17:44:02.679] > webUiAccessToken====
> listeningOn==39445==
> osReleaseId==rhel==
> arch==x86_64==
> tmpDir==/run/user/<uid>==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> extInstallTime====
> serverStartTime====
> connectionToken==1aaa1a11-1aaa-111a-11a1-11111a1aaa1a==
> 30ab31aac300: end
>
[17:44:02.679] Received install output:
SSH_AUTH_SOCK====
DISPLAY====
webUiAccessToken====
listeningOn==39445==
osReleaseId==rhel==
arch==x86_64==
tmpDir==/run/user/<uid>==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====
connectionToken==1aaa1a11-1aaa-111a-11a1-11111a1aaa1a==
[17:44:02.679] Remote server is listening on 39445
[17:44:02.679] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":39445},"osReleaseId":"rhel","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"","display":"","tmpDir":"/run/user/<uid>","platform":"linux","connectionToken":"1aaa1a11-1aaa-111a-11a1-11111a1aaa1a"},"installUnpackCode":""}
[17:44:02.681] Starting forwarding server. localPort 51518 -> socksPort 51498 -> remotePort 39445
[17:44:02.682] Forwarding server listening on 51518
[17:44:02.682] Waiting for ssh tunnel to be ready
[17:44:02.683] Tunneled 39445 to local port 51518
[17:44:02.683] Resolved "ssh-remote+test-machine" to "127.0.0.1:51518"
[17:44:02.684] [Forwarding server 51518] Got connection 0
[17:44:02.693] ------
[17:44:02.760] [Forwarding server 51518] Got connection 1
[17:44:02.870] [Forwarding server 51518] Got connection 2
[17:44:04.619] [Forwarding server 51518] Got connection 3
```
</details>
/cc @roblourens
and searching for “vscode X11 forwarding” should give more hints/info.
Thank you! We will see if this works. We have it working on the desktop using VS Code and WSL. We will work to get the VM installation up and running soon.
bmorgan
November 28, 2024, 2:46pm
6
Please do feedback if you get this working or have issues - would be useful to have this so we can add to the documentation if needed!
Sure! As soon as we have success, we will be happy to share.