Swing runs slow over remote X11 sessions


I don’t know what’s more painful, constantly switching keyboards between machines and virtual machines, or trying to get work done over any kind of remote session. I’ve installed a golden VM on my desktop at the office under VirtualBox. It’s golden because it’s configured in a way that I don’t wish to repeat/re-learn/re-configure. I’m prototyping somethings there which will eventually need to be moved to a production box. So on occasion I find the need to remote log in to my virtual machine running in the office. That requires that I scale the office firewall using a special VPN, with extra secret sauce security, start a remote session on my desktop via the command line, log into the remote session, start the virtual machine from the cmd line using “VMManage” then finally log into the virtual machine. I’ve learned that using the VNC session tied to my idle desktop hardly works due to long standing bugs/issues in KRFB. Also, trying to Use a secondary VNC display (like :1 or something) and log directly into VirtualBox from that display works marginally well. I recently tried VitrualBox TerminalServices support which allows you to use a Microsoft Windows remote desktop client to access the virtual machine. The advantage here would seem that audio is forwarded to the client. After getting this working using more cmd-Fu I learned that the audio forwarding only works with a Windows guest machine. I’ll have to lose a week sometime in the future to learn how to setup esd under Linux to get forwarded audio. Other than that the terminal services client support works marginally well. My latest attempt was to use remote X11 forwarding. Launching Netbeans on a remote VM is slooow. It takes over a minute for the screen to respond to mouse clicks. Probably over three minutes! I’m not really timing, I just got impatient and started writing this post after waiting for the splash screen. I get best results working directly on the machine without the remote software in between. I probably could run the IDE outside on the host instead of the guest btu then I’d have to fight with the impossible configuration of shared folders. All I want to do is write a simple C++ program that uses an API installed on the guest! At this point I might as well have installed the OS directly on my host using a partition. I’m still thinking of going this route. Does you know of any shortcuts? Yes, you! Stop reading and give me an answer already!

2 Comments

  1. Clayton Tabone

    Hi Cliff,
    I know that by know you most probably don’t need my reply, but I’m posting just the same. Swing runs slow over X11 because it is rendered on the client-side (i.e. where the Swing application is running, on the VM in your case). Hence the data has to be passed over the internet using X11 bitmaps. You could try to speed up the process by tunneling X11 over ssh and using compression. But I doubt that you’ll manage to make the system workable over the internet.

    Regards,
    Clayton

  2. Hi Clayton,

    I do need your reply so thanks for posting the same! ;) It never occurred to me that bitmap xfer was the bottleneck. At the time I just looked at it and said, “this is slow as [fill in with relatively slow moving object, bowel movement or animal species]!” Also I based this on my earliest experience running swing apps directly on a remote Linux host over X11 (which was several years ago and equally as slow). I suppose it makes sense but don’t all apps rely on bitmap transfer to work? I mean how is Swing different from native apps like Konqueror or KMail? In my earliest experience (once again several years ago) Swing was considerably slower than other apps run remotely over X11.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 251 other followers

%d bloggers like this: