How to Run VASSAL on Android

N.B.: This post is long, but mainly because the steps are thoroughly explained. The process is not all that long.

N.B.: Check if you need to re-run the setup to fix bugs here.

Background

A bit of background first.

  • Android is an operating system built on top of the Linux kernel.
  • Android apps are typically written in the Java programming language and executed in Android Run-Time environment (ART).
    • This Android-specific run-time environment is not a real Java Runtime Environment (JRE), and regular Java apps, in particular Graphical User Interface (GUI) Java apps cannot be executed by ART.
  • VASSAL is a Java application, and uses the Java GUI services.
  • The VASSAL app is executed in a Java Run-time Environment (JRE).
    • Java apps do not run directly on the metal, but are run through the JRE abstraction layer. This means a Java app, once build, can run on any system that can run the JRE.
    • VASSAL requires a true JRE, and the ART is not a real JRE, and VASSAL can therefore not be run directly on Android.

Thus, to run VASSAL on an Android device, we need to get a true JRE onto the device.

We will do that via the very powerful app Termux. Remember, Android runs on a Linux kernel, and we can therefore set up an environment which uses the Linux kernel and run regular Linux user-land applications and services there.

To get a Graphical User Interface (GUI), we need a few more things. The GUI back-end of Linux is X (nothing to do with what was known as Twitter, even though that service has appropriate the X name and logo). Android does not provide the X service, but we can set that service up in our Termux environment. But that is only half the story. We also need to have an X client that can actually show the GUI to us, and allow us to interact with the applications running on the server. Fortunately for us, X implementations speak the Virtual Network Computing (VNC) language, and we can thus use any of the available VNC apps available for regular Android.

With these considerations clear, we can go onto the practical steps needed to get VASSAL running on an Android device.

Using native X11

The good developers over at Termux have made the Termux:X11 app which seems to solve some inconveniences with the solution used here, while at the same time providing better performance. If you want to give that solution a try, stop reading and go here.

At some point in the future, we may rely on that app for running VASSAL on Android.


Installation

Needed Apps

For your set-up you need the following Android apps

Below we will go through the steps of setting these up.

Important

Command listed below must be typed into Termux exactly as written. Case matters, as in downloads and Downloads are not the same thing. For example, if the instructions tells you to write

pkg update
pkg upgrade

then two commands should be entered exactly as written above at the command prompt. That is first, type p k g [space] u p d a t e [enter] and then p k g [space] u p g r a d e [enter].

If you are reading this on your Android device, you can highlight the commands and copy them to your clipboard. In Termux you can then long-press anywhere and select Paste to paste in the command into the commmand prompt.


Install Termux

Follow the installation instructions on the Termux web-site.

Note There is a Termux app in the Google Play store - do not use that. Currently (2024 and for the past 3+ years), that app is not kept up to date.

If you install from GitHub, be sure to take the version appropriate for you device architecture. If you are unsure, or do not know what your device’s architecture is, take the termux-app_v*+github-debug_universal.apk app.

Whether you install from GitHub or F-Droid you will need to OK installation from “untrusted” sources. Please see this guide.

Once you have installed the Termux app, go a head and launch it as any other app on your device. You will be greeted by black screen with text on it. Take a minute to read the text. More information, including a “Getting Started” Guide is available at the Termux Wiki pages.

Give Termux Access to Android File System

After these two commands have finish, you must set-up Termux to have access to the regular device file system

pkg update 
pkg upgrade
pkg install -y termux-tools wget openssl
termux-setup-storage 

In the pop-up dialog shown, select Allow. This is kinda important so that you can use your regular Android browser to download VASSAL modules and they become available inside Termux environment.

Optionally, Install Termux:Widget app

To able to launch VASSAL directly from the home screen of your device, you need to install the Termux:Widget Android app. Please follow the installation instructions. As for Termux, do not install the app from the Google Play store.


Note, to make the widget work, you need to allow Termux to draw over other apps.

  • Open the Android settings
  • Navigate to Apps and select Termux
  • Scroll down and enable drawing over other apps

Install a VNC client

Pick any VNC client you like form the Google Play store (I chose RealVNC). Open up the app, and go past any introduction screens.

About Choosing a VNC Client

Your choice of VNC client largely determines your experience with VASSAL on your device. It is therefore worth a little effort to look around for the client that will best suit your needs. For VASSAL, you want the client to have a good mouse emulation and perhaps an improved on-screen keyboard. If the VNC client supports physical keyboard and mouse connected to the device (f.ex. via Bluetooth), then that is also attractive.


Installation and setup of packages and VASSAL

This is the recommended way to get you set-up with VASSAL on an Android device. No Warranty!

The script setup-vassal.sh basically does these steps. If you have problems with it, open a thread in the Technical Support & Bugs Forum.

The setup-vassal.sh script by default install the latest Java and VASSAL versions available. To set specific version, use the options -j and -v, respectively. For example, to install VASSAL version 3.7.23, do

bash setup-vassal.sh -v 3.7.23 

More information is available via the --help option

bash setup-vassal.sh --help

Adding a Widget to the Home Screen (optional)

If you installed Termux:Widget, then you can add a Termux widget to the home screen from which you can launch VASSAL.

Now we need to add the widget to the Android home screen.

  • Go back to the Android home screen and long-press the background.

  • In the pop-up menu, select Widgets and scroll down to find Termux:Widget. Long press it, and drag to the Home screen.

  • You will see a small widget (default 2x2) with a list of Termux short-cuts - in particular the short cut VASSAL. You can click that to launch the VNC server and client in one go and have VASSAL running in the Termux GUI environment.


Updating the setup

The latest setup-vassal.sh script is from January 26, 2025. If you ran the script prior to that, then consider to download the latest script and run it again (see above). It will not tamper with your modules, saves, and logs.

Note, you may need to remove previous set-up scripts so as not to get confused about which to run. Do

rm -f setup-vassal.sh*

before downloading the new set-up script.

Note: The set-up script will overwrite your ~/.vnc/config settings. So if you made changes to the screen resolution, perhaps you want to make a back-up first

cp .vnc/config .vnc/config.backup 

Clean after setup

After having run the setup script, you may want to clean-up a bit. Do in Termux

rm -f *.log *.tar.bz2 setup-vassal.sh 

Running VASSAL

If you installed the home-screen-widget, then you should be able to launch VASSAL by clicking the VASSAL entry in that widget.

Otherwise, you can start VASSAL by opening up the Termux app and type

~/.shortcuts/VASSAL start

In the desktop environment either click the Desktop icon or open a terminal

  • Select the Applications menu in the top-left corner of your screen
  • Select Terminal Emulator

In the terminal run

vassal

VASSAL running in the Termux GUI:

Running my version of the Gettysburg (125th Anniversary Edition) module (1.2-ch):

Stopping the VNC Server

Once you are done using VASSAL, simply quit the VASSAL application in the X session, which will automatically close that session. If that doesn’t work for you, you should stop the VNC server. In the Termux app execute

~/.shortcuts/VASSAL stop 

or

vncserver -clean -kill :1 

to stop the VNC server. The VNC client will be disconnected automatically and you can close that app too.

Getting VASSAL modules

To get your favourite VASSAL module, visit

https://vassalengine.org/wiki/Category:Modules

with your regular Android Web-browser, and download the module to your Android Download folder. For example, I took a version of the Gettysburg (125th Anniversary Edition) module (1.2-ch), which gave me the file

GettysburgSmithsonian-1.2.vmod.zip 

in my Android Download folder. Note that Google Chrome appends the .zip to the file name - it doesn’t actually put the file into a ZIP archive.

You should move the VASSAL modules to your Termux environment. Go back to the Termux app, and do for example

cd /sdcard/Downloads/ 
mv GettysburgSmithsonian-1.2.vmod.zip GettysburgSmithsonian-1.2.vmod

to remove the .zipfrom the file name. Here cd means “change directory” and mv means “move”.

Then, go back “Home” in Termux

cd 

and make a directory to hold your VASSAL modules, named for example
VMods.

mkdir -p VMods 

Here, mkdir means “make directory”.

We can then move our module there to that we have all our modules in a meaningful place

mv /sdcard/Download/GettysburgSmithsonian-1.2.vmod VMods/

You can also leave modules in the regular Android user file system, in which case the modules will be in some sub-directory of

/sdcard 

in your GUI session.

Alternative

You can also use the script get_vmod.sh. First, you should download it and make it executable

wget https://gitlab.com/wargames_tex/vassal_my_contrib/-/raw/master/android/get_vmod.sh -O get_vmod.sh
chmod a+x get_vmod.sh 

Then, you can execute it with a URL pointing to the module, and perhaps a URL pointing to an icon that will be used in the widget launcher. For example, to get Napoleon at Waterloo, do

./get_vmod.sh -u https://obj.vassalengine.org/images/b/ba/NapoleonAtWaterloo-ch-1.1.0.vmod -i https://obj.vassalengine.org/images/0/08/Pic2236172.jpg

This will download the module to your ~/VMods directory and add a short-cut to your VASSAL home-screen widget. Note that the icon should preferably be a PNG image of a size of at least 96px x 96px, but not too big either. If the image is not a PNG it will automatically be converted to a PNG. If you do not provide an icon URL, the module will still be downloaded and the short-cut made - it just won’t have an icon.

You can find the URL of modules in the VASSAL library by right-clicking (or long press) the module links and select something like Copy link address. For images, you typically want the thumbnail associated with the module. Click the image and in the page that opens, right click (or long press) the image filename and select Copy link address.

Restarting

If you [made a widget](#adding a-widget-to-the-home-screen-optional), simply tap the VASSAL entry again. Otherwise, open op Termux and do

~/.shortcuts/VASSAL start &

Adjust the screen resolution and configure VNC server

If the screen resolution fits your device poorly, then you may want to change it. Do

nano ~/.vnc/config

to make edit the configuration file for our VNC server. In nano you can edith lines

# Configuration of tigervnc 
# See also https://tigervnc.org/
localhost
depth=24
geometry=2400x1080

and then [ctrl]-x followed by y, and then [enter] to save the file and quit nano. See also [~/.vnc/config][dot-vnc-config].

Note that the argument to geometry defines the resolution of the graphical interface. You should adjust that to suit your device. Search the World-Wide-Web to find out which resolutions your device supports. If in doubt, fall back to something like 1024x768.

Note that if the resolution is set to higher than your device, then you will have a virtual screen that you can pan in (depending on the capabilities of the VNC client).

The localhost setting above means that only clients on the same device may connect to the server, thus limiting the risk of malicious “guests” to your device.

You can adjust many settings of the VNC server in the ~/.vnc/config file. Please refer to the TigerVNC documentation for more.

Upgrading VASSAL

If you want or need to upgrade your VASSAL installation, you should

  • From your regular Android browser, navigate to the VASSAL site and download the VASSAL version for Linux that you need - say VASSAL-3.7.10-linux.tar.bz2

  • Open your Termux app

  • Unpack the downloaded VASSAL archive

      cd 
      tar -xjvf /sdcard/Download/VASSAL-3.7.10-linux.tar.bz2
    
  • Remove the old current link

      rm VASSAL-current
    
  • Make the newly unpacked installation the current one

      ln -s VASSAL-3.7.10 VASSAL-current
    
  • You may want to delete the old (say 3.7.9) installation to free up some space, as well as the downloaded archive

      rm -rf VASSAL-3.7.9
      rm -f VASSAL-3.7.10-linux.tar.bz2
    

Upgrade Termux Packages

From time to time, you should upgrade the packages installed inside Termux. Do

pkg update 
pkg upgrade

More

Below are some tricks to get more out of your installation. If the installation and setup of packages and VASSAL via script worked for you, then these steps are more or less done already.

VNC start, stop, and connect

To start the VNC server, do in the Termux app

    vncserver :1 &

To stop the VNC server, do in the Termux app

    vncserver -clean -kill :1

To launch your default VNC client, do in the Termux app

termux-url-open vnc://localhost:5901

Download modules in the Termux GUI

In the VNC client connection to your Termux environment, open a terminal as described above and type

netsurf 

This will open a simple web-browser, which you can then direct to

https://vassalengine.org/wiki/Category:Modules

to find the module you want. By default, the modules are downloaded to your Termux home directory. You can move them to your VMods directory by typing in the terminal

mv ~/DDaySmithsonian-2.0.vmod ~/VMods/

for example.

Launch VASSAL with specific module, save, or log

Assuming your modules are put in ~/VMods, and we want to run the module GettysburgSmithsonian-1.2.vmod, then in Termux, run

.local/bin/vncvassal start xvassal -l $HOME/VMods/`GettysburgSmithsonian-1.2.vmod`

This will launch the VNC server, and connect with your VNC client, and in the X session you will have VASSAL running with the chosen module.

You can replace GettysburgSmithsonian-1.2.vmod with the filename of your favourite module, save, or log file. Note, spaces in the file names can be a problem. Consider to rename your file to something without spaces. That is easily done with

mv "File name with spaces" `echo "File name with spaces" | tr ' ' '_'` 

which will result in File_name_with_spaces.

From the Android home screen via Widget

Again, suppose we want to play GettysburgSmithsonian-1.2.vmod and we want to add an entry to the Termux widget menu. Then do

nano .shortcuts/Gettysburg_Smithsonian

and put the content

#!/data/data/com.termux/files/usr/bin/bash
${HOME}/.local/bin/vncvassal start xvassal \
    -l $HOME/VMods/`GettysburgSmithsonian-1.2.vmod`

Using a minimal graphical interface

By default, the scripts above uses the Xfce desktop environment. But, in some sense using a complete desktop environment is overkill. What we really only need is a window manager.

By replacing xvassal with xsimple_vassal in the above commands, you can opt to use the FluxBox window manager. This window manager is pretty simple and therefore light on the resources that it uses. Your VASSAL experience shouldn’t be much different from Xfce, except that regular desktop tools - such as file manager etc., are a bit more hidden away. On the other hand, you will get a clean desktop.


`

You should actually be able to copy your text here into the first post in thread. When you have done that I think it would be a good idea to delete the second post as it would be a duplicate. Then certainly we could change the title, link to it from that index page and mark it off as done.

On the image issue I am aware. I can fix that later.

EDIT: Actually I can probably progress this myself. Will do so later.

Done and done :slight_smile:

Great.

Great.

No need, done already :slight_smile:

(I guess these last two posts should also be removed :slight_smile: )

Yours,
Christian

I would prefer these posts to stay here actually. I can’t see anything wrong with those images. Oh and thank you very much for your work.

I would only worry that it will confuse the reader as it is more of a meta-discussion than a discussion about the issue (i.e., Running VASSAL on Android).

It’s not the images - those are, as you rightly observer, fine.

The problem is with the various “data” files (actually scripts and configuration files), specifically those under the heading Files for download i.e.,

These are currently links to the old Wiki pages, and I think they would be better if they where on the forum server. However, if they can stay at the Wiki pages, then that is also fine - as long as they are somewhere persistent.

I tried to trick the Forum server by changing file name endings (e.g., adding .png) but that didn’t work (and it shouldn’t).

You are welcome.

Yours,
Christian

Hmmm I am not sure. Please take this to discord.

Has anybody figured out how to use this by installing tightvnc ?

I am very inept at Termux (or any Linux system), but have been able to execute everything here UP to the point of installing a VNC client, as I can’t go the route of the monthly subscription price that RealVCN charges. However I am stuck after unpacking the tightvnc-1.3.10_unixsrv.tar.gz file, as the % xmkmf command that is in the README file only returns a “no such job” message, as does the % make World command. I’ve tried anything thing I could find on the internet to install… and nothing works. No access to root permission rules out using the sudo command, and apparently many other things…

Can anyone assist me with this?

TightVNC does not exist for Android - as far as I know - at least not as a native app (apk). You need an app that can display stuff, and for that you need a native app. You can use any VNC viewer (or client) you like - for example

Just pick the one that

  • installs on your device
  • fits your purpose

(clicking the above links on your Android device should take you straight to the Google Play Store)

You can install it from the Google Play store or from F-Droid - just like you would install any other regular Android app. You should not install it via Termux as Termux does not give you the graphics interface you need.

The instructions above are pretty clear that you need to install your VNC viewer (or client) from f.ex. Google Play and that it must be a regular Android app. Please make sure to read the instructions carefully as there’s a lot there.

The Android RealVNC client is free, and that’s all you need (RealVNC Connect is a server solution, and you do not need that). The VNC server (tigervnc) will be running in Termux and is likewise free and OpenSource (free as in beer and speech).

If you prefer a different client, by all means go ahead and use what ever client you want (see also here. A search (Android VNC Viewer Client) will quickly reveal a number of options.

You appear to be trying to install a tightvnc server from source inside Termux. While it may be possible, it would require a full development environment in Termux, which you probably do not have have. You are certainly not instructed to do anything like that in the above instructions.

Tell me, did you use The Quick (but experimental) Way or The steps in detail?

Which ever method you chose, you need to

If you chose the The Quick (but experimental) Way, then

  • Fire up Termux and download the set-up script
  • Run the set-up script, following the on-screen instructions

If you chose the The steps in detail, you must follow the instructions to the letter. There, you will be asked, at some point, to install tigervnc via the Termux package manager. This should work.

Which ever way you chose, you can then move on to Launch the Graphical Environment and follow the steps from there.

Yours,
Christian

Okay, thank you for your assistance. With a little more help, maybe I can get there.

I have carefully followed all the steps in detail instructions up to the point of installing a VNC viewer on my Galaxy A9+ tablet, and have just now installed the MultiVCN viewer (as the Internet seemed to indicate that the RealVNC Viewer might not work, or work as well with the TigerVNC server.) Also the Remote Ripple Pro link said that it was not available for the older Android device I have (which seems odd, as I just received it brand new.) Anyways, after installing the MultiVNC viewer from the Google Play store, it is asking for the following:

the address - I don’t know what to put here
the Port line default reads as 5900, but I think this should be 5901
the username - is this supposed to be left blank, or what do I fill in here?
Password - (presumably to the tigervnc server, which I know and have written down)
ID On Repeater - is this also left blank, or what goes here?
SSH Tunneling - turn this on, or leave it turned off?

Thanks again for your quick response and help with this.

Which set?
A. The Quick (but experimental) Way
B. The steps in detail

or, did you not get to that point yet?

Worked fine for me

Could you please answer wether you did A, B, or neither, from above?

This you should not do until you get to Launch the Graphical Environment, which you should not do until you did A or B above. If you have not done A or B above, please do so now.

Field Value
Address localhost (or 127.0.0.1)
Port 5901
User Blank
Password The one you made(*)
ID on repeater Blank
SSH tunneling off

(*)If you cannot remember the password you created, fire up Termux and run

vncpasswd

and make a new password.

Note, this is all detailed above in the instructions. I think you should really go back and read it again carefully (except ID on repeater and SSH tunneling which are MultiVNC specific and you should look that up in the documentation of MultiVNC.)

Yours,
Christian

I used the steps in detail instructions, and have just now successfully launched a MultiVCN viewer window. Now I will have to complete the rest of the steps in detail to install and test a Vassal module.

after getting Vassal up and running, I am now stuck at trying to download and install a the Vassal module that I need: Module:Bitter Woods (4th Edition) - Vassal

This is the link for the 2.7 version of it:
https://obj.vassalengine.org/images/6/61/Bitter_Woods_-_Designer_Edition_v2.7.vmod

However, when I download it, it adds .zip to the file name, making it a zip file… which doesn’t allow Vassal to open it, even if I decompress it, or drop the .zip off the file name. I have very carefully double checked the application-x-vassal.xml file in the ~/packages folder, and it appears to be perfect. Yet, when I click or double-click on the file (after deleting the “.zip” ending off the file after it downloads), nothing happens. HELP!

I don’t see where to open a terminal emulator in the applications menu in the top left corner of the MultiVNC screen. Ah… but I found it in the systems folder.

Et voilá, I now have VASSAL 3.7.15 running on my Galaxy A9+ tablet!

That was a major hurdle…

Okay, here is the update. After resetting the tablet (it was time to start over and try again), I very carefully followed the instructions and have succeeded in getting Vassal to run, as well the module for it… but there are still two items (the vnc server script and the shortcuts script) that just don’t work, no matter how I’ve tried to implement them. I have tried everything from copying the exact text from this page (as well as the other page that has these instructions) and then moving them to the tablet, deleting the .txt from the file, then using the nano command to check the file (which looks right), and then made the script executable with the chmod a+x command. I’ve even tried very, very carefully typing in the entire script, and it still doesn’t work. It simply looks like there is something amiss either in the script, or in the instructions… I’m not sure which, or what I am missing.

The server does start with the “vncserver :1” and stop with the “vncserver -kill :1” commands. However, after making the vnc script several different ways (and then making the vnc script executable), it always returns the following message with either the “./vnc start” or the “./vnc stop” commands:

bash: ./vnc: cannot execute: required file not found

after starting the vncserver with the “vncserver :1” command, the “termux-url-open vnc://localhost:5901” command returns this line:

termux-url-open: command not found

However, with the vncserver running, I can open the MultiVNC viewer, enter the localhost name, change the port number to 5901, enter the password… and it does connect and open the GUI screen… which the Vassal icon, which does open Vassal. Furthermore, the ONLY way that I currently have to open a module, or a .vsav, or a .vlog file is to first start the vncserver in Termux, then start the MultiVNC viewer, then connect to the vncserver, then open Vassal, then using the file menu within Vassal, select a module and then open it, and then from the file menu within the module then find and open either a vsav or vlog file. Otherwise, simply clicking on a vsav or vlog file from the file manager of the GUI Desktop does absolutely nothing, even if I select “open with Vassal” from the file menu. (And I have followed the same procedure of copying scripts for the application-x-vassal.xml file, which is supposed to associate .vmod and .vlog files with Vassal.)

Lastly, launching VASSAL from the Android home also does not work. (The Termux:Widget that I have installed is Release v.0.14.0) When I click on it from the Galaxy A9+ homescreen, it opens a Termux window and returns the following message:

exec(“/data/data/com.termux/files/home/.shortcuts/VASSAL”): No such file or directory

Which makes no sense to me, as the directory ~/.shortcuts does exist (as I can go to it with cd ~/.shortcuts) and when I do and type in the “ls” command, it list both the VASSAL file and the tasks directory

Not sure that it made a difference (but if so, let me know) was the JDK package installed was 21.0 (not 17.) If so, then I’m not sure how to uninstall 21 and then install 17.

Hugh

P.S. I did find a small error (easily correctable) in your instructions above, in this line:

cd /sdcard/Downloads/

Clearly the “s” should be omitted from the end of Download

So to be sure

  • Starting and stopping the VNC server works for you?
  • Connecting to the VNC server from a VNC client works for you?
  • Launching VASSAL from your virtual Desktop works for you?
  • Loading a module into VASSAL works for you?

If so, then you everything works for you, except some “goodies”, right?

It would be great if you could format your messages a bit to make them a tad easier to read.

Are you sure your vnc script is in the current directory? Test with

$ ls

Note that your Android “home” directory and the Termux ~/ are not necessarily the same. Make sure you’re in the right directory. Note, if you use the Quick (but experimental) way then most files are generated for you and should be correct.

If you want to be able to execute the vnc script from anywhere in Termux, put it in ~/.local/bin.

Try termux-open-url - a typo on my part.

[quote=“Hugs, post:15, topic:79268, full:true”]
However, with the vncserver running, I can open the MultiVNC viewer, enter the localhost name, change the port number to 5901, enter the password… and it does connect and open the GUI screen… which the Vassal icon, which does open Vassal. Furthermore, the ONLY way that I currently have to open a module, or a .vsav, or a .vlog file is to first start the vncserver in Termux, then start the MultiVNC viewer, then connect to the vncserver, then open Vassal, then using the file menu within Vassal, select a module and then open it, and then from the file menu within the module then find and open either a vsav or vlog file. Otherwise, simply clicking on a vsav or vlog file from the file manager of the GUI Desktop does absolutely nothing, even if I select “open with Vassal” from the file menu. (And I have followed the same procedure of copying scripts for the application-x-vassal.xml file, which is supposed to associate .vmod and .vlog files with Vassal.)[/quote]

What you describe

  1. Launch VNC server in Termux
  2. Open VNC Client and connect
  3. Launch VASSAL in VNC client
  4. Open VASSAL file (.vmod, .vlog, or .vsav)

is indeed the expected procedure. If you did install the termux-widgets package and have things set-up, you can automate steps 1-3 above, but step 4 will most likely always be needed.

I have not tried to get the Android UI to launch VASSAL (via termux-widgets) by selecting a VASSAL file in file browser or the like, so I’m not sure whether to expect it to work. If you used the Quick (but experimental) way, then within your VNC desktop, it should be possible to double click a VASSAL file and have VASSAL open it automatically.

Have you check to see if ~/.shortcuts is indeed /data/data/com.termux/files/home/.shortcuts/? In Termux do

$ cd ~/.shortcuts
$ pwd 
$ cd /data/data/com.termux/files/home/.shortcuts/
$ pwd 

Both pwd should give the same answer. Again, your Android home directory and your Termux ~/ are not necessarily the same.

Makes no difference. The newer the better :slight_smile: Also, I think Termux only supports one version of Java so I don’t think you have a choice.

Sometimes its Download other times its Downloads. Perhaps should put a note on that.

Yours,
Christian

Okay, thanks for your help, it looks like I am much closer to getting there. Here is what I’ve done, what is working, and what still doesn’t appear to be working right.

termux-url-open vnc://localhost:5901

That works. However, after checking your recommended 4 step procedure to check if ~/.shortcuts is indeed /data/data/com.termux/files/home/.shortcuts/ (which it is), neither the widget nor either of the following commands worked, even after copying the vnc script from the home directory to the ~/.local/bin directory (a new directory which I also had to make with mkdir.)

./vnc start
./vnc stop
.~/.local/bin/vnc start
.~/.local/bin/vnc stop
./data/data/com.termux/files/home/vnc start
./data/data/com.termux/files/home/vnc start
./data/data/com.termux/files/home/.local/bin/vnc start
./data/data/com.termux/files/home/.local/bin/vnc start

None of the above commands work, they all return the error message:

bash: .{whatever directory is used}/vnc cannot execute: required file not found

And yet, using the ls command shows that the vnc script is actually in both the home directory and the ~/.local/bin directory.


So… that said, I decided there was probably nothing much to lose trying to use the Quick (but experimental) way that you suggested. Overall, I have to admit that it actually seemed quite simple compared to doing everything step by step… but perhaps starting that way helped me through a few necessary steps in the process.

I changed the VASSAL module in it to 3.7.15
I also changed the Widget version to 21
Then I ran it through the installation process.

The result was pretty good. The widget from my Galazy A9+ tablet now works, and launched the MultiVNC viewer… and after a restart of the tablet and a second launch, it also opens Vassal.
However, I would prefer that it bypassed the screen that it first stops at asking whether or not I want to start it. Of course I do, as I clicked already clicked on it! Is there a relatively simple way to edit that out of the ~/.shortcuts/VASSAL file so that it doesn’t pause there to have to answer that silly question?

Also worth noting is that I then had to edit the ~/.vnc/config file to change this line in it to better match the tablet: geometry=1920x1200

That all appears to work.

Now, here is what still doesn’t work:

./vnc start
./vnc stop

same problem and error message as before. Consequently, I don’t seem to have a clean or easy way to exit the Vassal Desktop. If I choose “disconnect” from within the MultiVNC screen, something doesn’t close cleanly and it won’t work until after I use the Termux app to issue this command:

vncserver -kill :1

after which it tells me:
Xvnc did not appear to shut down cleanly. Removing /data/data/com.termux/files/usr/tmp/.X11-uniX/X1
Xvnc did not appear to shut down cleanly. Removing /data/data/com.termux/files/usr/tmp/.X1-lock

So, apparently I don’t know how to end or exit the MultiVNC session correctly.

Much more concerning however, is this: Neither the .vmod nor the .vlog files open by double clicking on them, nor by choosing to open them with Vassal from the dropdown menu that opens for them after clicking on them. The ONLY way to open a vsav or vlog file is to first open the correct module for them, and then from within that particular module’s file menu, selecting a vsav or vlog file for loading, and then move on to the next step for opening. It’s a VERY tedious process that doesn’t seem right. It’s certainly NOT the way it normally works in a Windows environment.

Why is this still not working, and how can it be fixed?

Thanks again for your help,

Hugh

Hi,

Skipping to the issue

The point of the Quick (but experimental) Way is to make it as easy as possible. I’m not sure going through the detailed steps is all that instructive.

That’s right. You should change the VASSAL version to the newest version available. For Termux:Widget you also just need to get the newest.

You shouldn’t need to restart the tablet - after all, its Android (Linux underneath) - not Windoze

Edit the file ~/.shortcuts/VASSAL and comment out the lines

read -n 1 -p "Do want to start? (Y/n) "
case x\$REPLY in
  xy|xY|x) oper=start ;;
  *) oper=stop ;;
esac

That is, the lines should be prefixed with # as in

# read -n 1 -p "Do want to start? (Y/n) "
# case x\$REPLY in
#   xy|xY|x) oper=start ;;
#   *) oper=stop ;;
# esac

That is fine. It’s a matter of preference whether one wants a virtual screen larger than the physical one.

The vnc script is a part of the detailed way, and you should not need it if you did the things the quick way. Delete that script

rm vnc 

No, that doesn’t follow from the above problem - in fact, that’s totally unrelated.

If you started your session via the Termux:Widget, or by executing

~/.shortcuts/VASSAL

you simply need to exit the VASSAL application, and the session will shut down cleanly.

That said, there’s absolutely nothing wrong about

vncserver -kill :1 

and you can safely ignore the “error” messages from Xvnc. That is, if you saved what you need to save before you did that.

First, I assume that you are double-clicking the files through the file browser in the VNC session - not in a native Android file browser - the latter will never work!

Right, I see you problem. This has to do with how Termux is run on Android, and how the desktop want’s to launch applications associated with specific file (mime) types. It’s a little convoluted, but suffice to say that since Termux is running in a sandbox, it means that the desktop cannot access things like it would like to.

I think I might have a solution - stay tuned.

Not sure what you mean by “open them with Vassal from the dropdown menu that opens for them after clicking on them”. Do you mean you right-click the files in the VNC session file browser? Then it’s the same problem as above.

BTW, you can easily take screenshots of your phone screen by long pressing the power button, or swipe up from the bottom to get the task menu and select “screen shot”.

Well, that’s how many people do it. Note, when you want to load a save or log file, then you must have already loaded the module at least once (so that the module manager knows about it) and it must be the correction version. Otherwise it won’t work.

In more detail. Suppose you got the module A.vmod with the save A.vsav, and you’ve never open the module before. Then, executing

VASSAL.sh -l `pwd`/A.vsav 

will not work. In that case, you need to pass both the module and the save to the -l option

VASSAL.sh -l `pwd`/A.vmod `pwd`/A.vsav

Of course, you could also first do

VASSAL.sh -l `pwd`/A.vmod

followed by

VASSAL.sh -l `pwd`/A.vsav 

Because there’s a deeper problem and no-one has fixed it or brought it up till now.

Thanks again for your help,

Hugh
[/quote]

I found the solution - please re-download and re-run the set-up script

wget https://gitlab.com/wargames_tex/vassal_my_contrib/-/raw/master/android/setup-vassal.sh -O setup-vassal.sh
bash setup-vassal.sh 

This fixes

  • File association in the GUI session. Double-click .vlog, .vsav, or .vmod to open the file in VASSAL.
  • Set-up script automatically deduces the latest Java and VASSAL version to download and install. Users can override this detection by using command line options -j and -v respectively.

Yours,
Christian

Okay, I’m making progress. After editing the VASSAL file, clicking on the Widget bypasses the need to answer “Y” and opens to the MultiVNC’s request to enter a password.

Is there anything else that can be added into the script that includes the password to the VNC server, so that I don’t have to enter a password each time after clicking on the Widget? That would be nice to know, if so.


Now, as for being able to easily open either the .vsav or .vlog files, that still does not appear to be working, even after downloading and re-running the set-up script that you just revised. I actually don’t care much about the .vmod file, as that is really only a one time install that can be opened (and executed successfully) from the dropdown File menu once the Vassal program is open in the GUI desktop environment. It’s the .vsav and .vlog files that matter.

Does it matter where the .vsav or .vlog files are located? I have them on the GUI Desktop, but double-clicking on either of them only brings up a drop down menu (as shown below), which asks which app you want to try to open them with. Selecting “Vassal” still does absolutely nothing, and won’t open either of them.

As you are already probably aware, in the Windows environment, any .vsav or .vlog file also displays a Vassal icon. Furthermore, when clicked on, it automatically starts, opens and/or loads into the same Vassal module that it was saved with. (And I have no idea how or why that works, it just does… lol.)

In this Android GUI window, it still appears to require the following tedious steps to even get started:

  1. First, open the Bitter Woods module (double clicking on it does not open it either, it merely opens a menu from which you must then select and click on “open module”.)
  2. Then, click on the File menu of that now open module to access the drop down menu there,
  3. Then, click on the “Load Game or Log…” option
  4. Then find the vlog or vsav file to load
  5. Then click on the file to select it
  6. Then click on the Open button on the lower right of that window to finally open it.

Let me know what I am missing, or maybe you are still working on a revision or script that can be executed that will fix this.

Many thanks again for your generous and greatly helpful assistance with this.

Hugh

Let me stop you right there - please do not do that - but go and get the setup script again (third time’s the charm) and execute it

wget https://gitlab.com/wargames_tex/vassal_my_contrib/-/raw/master/android/setup-vassal.sh -O setup-vassal.sh
bash setup-vassal.sh

That should fix most of your issues.

No, I don’t think so. The client (an Android) app must pass the password on to the server, which means the client must be aware of the password. What you do in the Termux scripts are mainly server-side - except for the request to the Android OS to launch an app that can handle a VNC connection. In principle one could pass the password through that request, but that isn’t supported by many VNC clients (including RealVNC, AVNC, and MultiVNC).

It does not matter where the files reside.

For me, with the latest changes I did in the setup script (earlier this evening), it works absolutely fine for all 3 file types.

The Windoze installer of VASSAL register file types with Windows, and says how they should be handled. That’s how it works. Maybe the MacOuze installer does the same thing - I have no idea. On Linux, the “installer” is a simple unpack, and it sets up nothing (it could - and I’ve shown the devs how to).

You mean the X desktop - “Android GUI” I take to mean a native Android app. What you are interacting with is an X server, through a client, running on a Termux/Linux machine.

That seems awfully more convoluted than what you would need. Starting from the VASSAL module manager:

  • Double-click the module you want to load
    (how to make a double-click depends on your VNC client - check documentation).
  • In the wizard greeter, select Load saved
  • Press the Select button and navigate to the .vlog or .vsav file you want to load
  • Wait for the save or log to load and then press Next, then select your side and hit Finish

That’s a perfectly reasonable and normal way of loading a save or log for a specific module.

Any case, please try to re-download the setup script and re-run it. I had a few bugs in the previous iteration.

Yours,
Christian

Ok, I’ve rerun the download… then edited the config file to adjust the screen size, as well as the VASSAL file to eliminate the need to answer whether I wanted to start the X desktop.

As of right now, it appears that everything looks good, works as well as it should, and is as good as it’s going to get unless or until the developers over at Vassal changes how Linux installs or unpacks a vsav or vlog file. (At least until I try attaching a mouse to the tablet… which I will likely attempt to do at some point here in the near future.)

So, many thanks for your help, you’ve done great! I think you’ve made what would normally be an extremely difficult (if not impossible) task for most people a relatively simple and far easier task than what it probably looks like (and for me, started off as.)