org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed] while running eclipse on ubuntu

This is also the error you get if you try to start Eclipse over ssh without forwarding X access. Ie, you forgot to run ssh -X user@host or forgot to include ForwardX11 yes in your ~/.ssh/config entry for the server.

I'm adding this answer for anyone who may stumble upon this question from a Google search even though technically, OP is asking about a VM case.


In addition, this may also be caused by the application not having the correct authorization to display to the remote X server. This typically happens when you log into the ssh session as one user and execute a command as another user to lauch a GUI application. For example when you log into the remote server and execute a sudo command. To resolve this issue, you will need to obtain the magic cookie of the user logging in and import the cookie for the user running the command.

As the user logging into the server which has authority to display to X, run:

xauth extract cookie_file $DISPLAY

Then as the user trying to run the gui: xauth merge cookie_file

Once the cookie is imported into the user's .Xauthority file, you should be able to execute the GUI.


I think this is a problem with gtk. Check what version is installed.

dpkg -l libgtk[0-9]* | grep ^i

If it's not installed or is the incorrect version then do a sudo apt-get install gtk or do an sudo apt-get update.

EDIT

The problem was that SSH was using SSH to remote into a Linux VM and didn't have an X-Server set up on Windows and didn't have X11 forwarding enabled. After getting that straightened out the OP shouldn't have any issues running Eclipse.