If the server is cloud hosted, then presumably you're not already running a full x server there and using vnc to start an x session?
If that's the case then, before you waste a lot of time and effort, why not just login to the admin UI remotely (kind of what it's designed for)?
https://glassfish.org/docs/5.1.0/adm...iew.html#ablav
(I'm not familiar with Glassfish, but personally I would block connections on that port and just create an ssh tunnel, then login using localhost:PORT)