Thomas Fischer's Weblog

Life, Linux, LaTeX

Enlarge Fullscreen Programs in Wine

with 8 comments

Back in the good old days, PC games used a resolution of 320×200, 640×480, or maybe 800×600 for the game play. This was even true for Windows games. Then it was common to have a 15″ CRT monitor which could display a large number of different resolutions with only little loss in quality.

Today, we have nice and shiny LCD displays, which are perfect for common office tasks. But with a horizontal resolution of e.g. 1600 pixel, you have a problem when playing these old games. Basically, you have two options when running your games with Wine: Scale the game’s small resolution to your display’s physical resolution (which looks ugly depending on the interpolation and the display’s aspect ration, e.g. widescreen displays) or run the game in a small window which makes a game designed for fullscreen displaying as large as your palm. No fun playing games here…

As far as I know, there is no possibility to scale a Windows program in Wine to make it more readable for high-resolution displays. However, I was able to create an ugly hack which allows us to “zoom” into these programs. The basic idea is to set up a dedicated X server with a fixed resolution for the Windows program and use a VNC connection (which can scale images) to get an enlarged view on this program.

If you like to follow the examples below, you will need to have the following programs installed:

  • Xephyr, which is part of your X server installation
  • Wine, installed and configured to run programs fullscreen (deselect “Emulate a virtual desktop” in winecfg)
  • x11vnc
  • RealVNC, TightVNC, or any other VNC client (server component not required here)

Most distributions such as Gentoo Linux provide packages for above programs.

Getting started

To run Windows programs within a scaled VNC session, the following four easy steps are neccessary. You can start each program in the background by appending an ampersand (&) or opening a terminal (simplifies debugging if something doesn’t work).

  1. Start Xephyr to initiate a nested X server session. Set the resolution to match the requirements of your game (here, it is set to 640×480). I observed that some programs crash if the GLX extension is activated, so I disabled it here. The display number is set to 5 (arbitrarily).
    Xephyr -once -screen 640x480 -extension GLX :5
  2. Start Wine and your Windows program. Take care to use the display provided by the new Xephyr instance.
    DISPLAY=:5 wine path/to/your/windows/program
  3. Start the VNC server which attachs to Xephyr’s display. Only connections from localhost will be accepted (for security purposes) and the scaling factor will be set to 2 (change to other factor to match your requirements). Option “:nb” speeds up the scaling.
    x11vnc -localhost -scale 2:nb -display :5
  4. Start the VNC client which connects to the server (the following example is for RealVNC).
    vncviewer -FullColor -ZlibLevel 0 localhost

Well, this is rather cumbersome, but it works 🙂

Shell script

Here is a shell script which performs above operations:



# start Xephyr in background
# note: *with* GLX extension wine crashs sometimes
${XEPHYR_BIN} -once -screen 640x480 -extension GLX ${XDISPLAY} &
sleep 2

# start wine

# start VNC server
${X11VNC_BIN} -localhost -scale 2:nb -display :5 &
sleep 3

# RealVNC
## ${VNCVIEWER_BIN} -FullColor -ZlibLevel 0 localhost &
# TightVNC
${VNCVIEWER_BIN} -compresslevel 0 -nojpeg localhost &
# keep for both RealVNC and TightVNC

wait ${WINE_PID}
sleep 1
sleep 1
sleep 1
kill ${XEPHYR_PID}


Written by Thomas Fischer

February 14, 2009 at 14:50

Posted in Linux

Tagged with ,

8 Responses

Subscribe to comments with RSS.

  1. Are you using the non-proprietary drivers when doing this? I tried with the nvidia binary driver and GLX is shown to be missing on the respective display (per wine and glxinfo).

    I’m using whatever version of Xephyr that comes with Ubuntu Intrepid 64bit.


    April 14, 2009 at 22:00

  2. I’m not an X expert to answer your this question. You can do two things to find out more on why it does not work. First, try to run winecfg with my script. If it gets magnified, the whole Xephyr/VNC stuff works in general. Second, try to run your Windows program in plain Wine, i.e. without any of the tips shown above. Depending on the output of these tests you know where to search for your problem’s origin.

    Thomas Fischer

    May 4, 2009 at 20:17

  3. Wow, guys, don’t jump through hoops here. Just get Compiz working and play around with the “Enhanced Zoom Desktop” plugin. Set the plugin to restrain your mouse to the zoomed area.


    July 7, 2009 at 10:14

  4. 4 years later, your post is still relevant. Works great for me. The only change is that I use ‘vinagre –fullscreen’ for the VNC client. One might also want to use ‘–scale 1080/480’ (depending on your screen resolution) to maximize the window size.


    October 9, 2013 at 1:58

  5. Nice, but only a thing, I have improved your script performance:
    instead of -scale 2:nb or any other fraction like 2/3 or 1.6 you can get better results with
    -scale 1366×768 (being that the desired resolution), this makes the game way less pixeled and it is easier to adjust (else you have to try a couple of times at least)

    I did not need -ZlibLevel, actually cannot use it really


    November 30, 2014 at 21:39

  6. I have always suspected enlargement of program appearances can be done via vnc but I didn’t have the know how. Now I know how! Small UI font sizes in programs are an increasing problem and adjusting the desktop environment settings often doesn’t work or is impractical. With a few modifications, this technique also works for native linux applications that for whatever reason the UI doesn’t obey the desktop environment settings.


    December 30, 2015 at 22:33

  7. Thanks for this solution, it’s awesome and works like a charm, except for one thing. When the mouse leaves the TightVNC window, keyboard events are no longer sent to it. Can anyone suggest another client that doesn’t have this problem, and maybe help me with what commandline options I should use?


    January 14, 2016 at 8:05

  8. Thanks for the solution, for Ignition game was working great for the vivanonno emulator it consumes too many resources. I found another solutions hope it helps someone else.
    The solution is to use xrandr to change the scale of you desktop before and after running the game.
    For example

    cd (game path)
    xrandr –output HDMI-1 –scale 0.55×0.55
    /opt/wine-staging/bin/wine explorer /desktop=foo,640×480 (game.exe)
    xrandr –output HDMI-1 –scale 1×1


    May 9, 2017 at 18:50

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: