Running VMD on HDPI (high DPI - i.e. high resolution) screens in Linux remains a challenge due in part to the underlying FLTK library.
After exploring this for a while I came across the current solution which works reasonably well and should be relatively robust across cross-linux platforms. I'd be delighted if there were a simpler way, so please pull-request and update this if/when a better solution emerges. I wanted to write this so that someone with a minimal background in Linux could still get this up and running, as many people who use VMD may be new to Linux computing. If this describes you and things remain unclear, please
run_scaled
is a simple but incredibly helpful bash script written by Alexander Kauer. It can be downloaded from here and added into your $PATH
. If you know what this means, jump ahead to the Dependencies section.
$PATH
is a list of location that the shell checks for executable files when you type something into the terminal. To see which directories are currently in your $PATH
variable type
echo $PATH
# on ubuntu 18.04 this reveals
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
Now you have two options for adding things to your $PATH
. One is to select one of those directories and copy the file run_scaled
into that directory. To do this you may need to copy as root. A better option, however, is to create a new directory in user space where you can add any/all executable files you might want to use.
To do this, we'll create a file in our home directory called bin
cd ~ # cd to the home directory
mkdir bin # make the directory bin
Then copy run_scaled
into this directory and make sure the permission is set to executable - i.e. if you downloaded run_scaled
into your home/<username>/Downloads
folder and were currently in your home directory, this would look like
cp Downloads/run_scaled bin/
To check this has worked, type
ls ~/bin # list all the files in the newly created bin directory
This should print the name run_scaled
to the terminal prompt. Note that '~'
is shorthand for your 'home' directory.
Finally make sure run_scaled
is executable by running
cd ~/bin
chmod +x run_scaled
This moves us to the ~/bin
directory and adds the eXecutable permission stamp to the file (if it's already executable nothing bad will happen).
Finally, we have to add the directory /home//bin to the $PATH
. The easies way to do this is to edit your shell configuration file. To check what shell you're running type
echo $SHELL
If this prints out either /usr/bin/zsh
or /usr/bin/bash
then great! If it prints out something else you may need to do some Googling to check how to add a directory to the $PATH
in your shell.
For zsh
or bash
this is easy though.
If you're running zsh (echo $SHELL
= /usr/bin/zsh
) then enter the following into your terminal:
echo "export PATH=\${PATH}:~/bin" >> .zshrc
If you're running bash (echo $SHELL
= /usr/bin/bash
) then enter the following into your terminal:
echo "export PATH=\${PATH}:~/bin" >> .bashrc
Both of these commands add the line
export PATH=${PATH}:~/bin
To your .zshrc
or .bashrc
files, respectively, adding the directory ~/bin
into the $PATH
. To check this has worked start a new terminal and typ
echo $PATH
and, HOPEFULLY your /home/bin directory is now the last directory in the $PATH
.
run_scaled
actually uses a few other bit of software to work. These are
- xvfb
- xpra >= 2 https://xpra.org/
- xrandr
For Ubuntu 18.04 these dependencies can be installed via
sudo apt install xpra
sudo apt install xvfb
Finally, to use runscaled with vmd simply type
run_scaled vmd
Or
run_scaled --scale=3 vmd
Where the '3' can be any number and defines the scaling factor
This format can still pass arguments to vmd; e.g.
run_scaled --scale=3 vmd my_pdb.pdb
The interface may be slightly laggy, but not to a extent that is problematic. However, the window text can now be easily scaled without issue, making everything legible.
I wanted to put this in one place because in all my Googling of VMD with small font, small text, can't read, I didn't find an example where someone had discussed the VMD-issue with run_scaled
Hi, Prof. Holehouse.
Thanks a lot for the guide. I can run lots of GUI apps scaled up with this script, but VMD seems to quit itself automatically when I run
run_scaled vmd
.Here is the log of xpra.
There doesn't seem to be anything wrong with VMD. It just launches and then immediately quits.
Does this workaround still work on your side?