How do I start vassal in Linux?

Ok, this is probably an easy one, but I searched and couldn’t find. Running a Chromebook with android Version 118.0.5993.124 (Official Build) (64-bit). Enabled linux, downloaded the linux files and unpacked. How do I execute the vassal.sh file? I am a first time linux user. Sincere apologies if I’ve missed something obvious. Usually google will provide an answer, but too many unknowns for me to decipher.

I dd successfully install Java per the instructions as well.

You run VASSAL.sh in a terminal, like any shell script. E.g., from the directory where, VASSAL.sh, is:

./VASSAL.sh
1 Like

Success! There was a little more to it than executing, I found out, but after a few hundred trial and errors, got it working. Joel, thanks for the help, it gave me enough of a clue that I could keep going. Sometimes that’s all it takes. Really appreciated.

Would you mind explaining what you did, for anyone else who sees this thread?

Sure, should have thought of that too. Basically, I had to:

  1. learn the command line syntax, e.g. cd, ls, etc., enough to be able to change directories and list out files.
  2. Figure out the file structure of the chromebook, which (on mine) is mnt/chromeos/[MyID]/Myfiles and so on. The vassal.sh file helped clue me in on that. Double clicking on the vassal.sh file resolved to the correct path, which then I could navigate to.
  3. Realize it’s case sensitive, I’m used to working in the opposite

The breakthrough was really #2, once I had that, was just a matter of navigating to the right place.

I’ve gotten so used to point and click that my command line skills were seriously rusty. And to think at one time, that’s how we all worked.

Once again, the community saves the day! :partying_face:

3 Likes

Would like to add for other Linux beginners like myself that, depending on your distro or desktop environment, you may be able to add Vassal to the equivalent of the Start menu and not have to rely exclusively on the terminal to launch the program.

In Linux Mint Cinnamon edition for example, I was able to do that by right clicking on the start button, then click Configure, then select Menu tab, then click Open The Menu Editor where you will see a list of Applications categories. One can click Games, then New Item, then give it a name like Vassal, browse to and choose the Vassal.sh file in the Command input box, then add a checkmark to Launch in Terminal?, then click the icon on the upper left and browse to and select the Vassal.svg file for the custom icon and then finally click OK to finish.

Now, you will see Vassal with its custom icon in your menu under Games as well as All Applications to make it easy to launch Vassal without the terminal. It’s convenient for keyboard focused use as well since you can just hit the Super key and start to type V-A and the menu selection should come up automatically for easy selection without using a mouse.

1 Like

This is a test for RobS.

i bought a Chromebook to play vassal on. i didn’t realise it wasn’t straight forward using Linux. does anybody know if there are any step by step guides to setting it up ? my Chromebook has almost gone out the window a couple of times ! :))

Have you tried this? Getting Vassal to work on my Chromebook

1 Like

Yes i get exactly the same result as Robert1 did in the thread

I am going from my experience muddling through it, but from the result you referenced, I think you have to navigate to the directory where the file is to run it like that. for example, on mine the file is located at /mnt/chromeos/MyFiles/VASSAL. You can see where the downloaded file is in the Files app.

Sorry if you knew this already, but I had the problem, and just needed to understand the file structure in the chromebook. I hope this helps.

1 Like

my file is here /mnt/chromeos/archive/VASSAL-3.7.6-linux.tar.bz2/VASSAL-3.7.6
but i dont know what to do with this infomation
im out of my depth here i dont know what im doing

you probably need to extract the files in the tar.bz2 file. It looks like you are trying to run VASSAL while it is still in the tar and zipped file.

1 Like

Try this:

from your prompt: cd /mnt/chromeos/archive

You should then see the name of that directory come up. Then run the tar command to unzip. You have to be in the same directory as the file you’re unzipping, and this should get you there.

I think chromebook comes with a GUI :wink:

(My interface is in french but it’s easy to understand what’s going on)

Maybe the /mnt/chromeos/archive directory is not a user directory, i expected something like “/home/dan77/Downloads/VASSAL-3.7.6-linux.tar.bz2”

Hi there,

A few things on VASSAL and GNU/Linux (including ChromeBooks).

  • When you download VASSAL it will typically end up in ~/Downloads as something like VASSAL-3.7.8-linux.tar.bz2.

    • This is a compressed (using BZip2) TAR (Tape ARchive) ball.
    • ~/ means your home directory - typically something like /home/user name
  • The rest will use the terminal. To open a terminal open your application menu and search for Terminal.

    • The terminal runs a shell (or command shell), typically something like Bash.
    • The shell is Your Friend - here you can do all sorts of things in a very effective way. It is much more than a program launcher. Long time Un*x users often use the shell to automate things, do complicated tasks, and so on.
  • To navigate to your home directory, simple do one of

     cd 
     cd ~ 
     cd $HOME 
     cd /home/$USER
    
  • To go to your Downloads directory, do one of

    cd ~/Downloads
    cd $HOME/Downloads 
    cd /home/$USER 
    
  • There’s no concept of drives on Un*x. Filesystems, whether on disk, remote, or an archive are mounted into the filesystems rooted in - well - the root /

    • To see the currently mounted filesystems, do

        mount 
      
    • F.ex, /mnt/chromeos/archive/VASSAL-3.7.6-linux.tar.bz2 is a compressed archive (probably from ~/Downloads/VASSAL-3.7.6-linux.tar.bz2 mounted (the /mnt at start of the path is a clue).

    • Incidently, when a MacOSX user clicks a disk image .dmg, this is also what MacOSX does - mounts the archive as if it was a disk.

    • In principle, you can run programs, etc. from a mounted archive, but there will be an overhead since the system needs to unpack the archive in memory. So a better option is to unpack the archive somewhere more permanent.

  • To install VASSAL properly, go to your downloads directory

    cd ~/Downloads 
    
    • Decide where you want to install VASSAL. For the sake of the example, say you want to install it into ~/applications. First we make that directory if it isn’t there already

      mkdir -p ~/applications 
      

    The option -p means make all parents and do not fail if any part of the path already exists.

    • Next we should unpack the cmpressed archive to its install locations

       bzip2 -dc VASSAL-3.7.6-linux.tar.bz2 | tar -xf - -C ~/applications 
      

      Here,

      • bzip -dc decompresses the file to standard output (the screen)
      • The pipe | or FIFO, connects the output of the application on the left to the standard input (keyboard) on the right
      • tar -xf - unpacks the archive read from standard input (-) and the option -C ~/applications says that it should be unpacked in the directory ~/applications
    • You will now have the directory

      ~/applications/VASSAL-3.7.6 
      

      which contains the file VASSAL.sh.

      • Thus, you can launch VASSAL from anywhere with

        ~/applications/VASSAL-3.7.6/VASSAL.sh 
        
      • It’s a bit cumbersome, so let’s make it a bit easier .

    • Go to the ~/applications directory

      cd ~/applications 
      
    • Make a symbolic link from VASSAL-3.7.6 to VASSAL

       ln -s VASSAL-3.7.6 VASSAL 
      

      VASSAL is now a filesystem entry that behaves exactly like VASSAL-3.7.6 but is not a copy.

    • If you later on install an upgrade to VASSAL in the same directory - say VASSAL-3.9.99, you can simply redefine the link

      rm VASSAL 
       ln -s VASSAL-3.9.99 VASSAL 
      
    • Now you can execute VASSAL from anywhere by

      ~/applications/VASSAL/VASSAL.sh 
      

      but that’s still a mouth full, so let’s make it even easier.

    • Go to your home directory

      cd 
      
    • Open the file ~/.bash_aliases with your favorite editor

      xdg-open ~/.bash_aliases
      

      Type in into that file

      alias vassal=$HOME/applications/VASSAL/VASSAL.sh 
      

      and save the file.

    • Now close your current terminal and open a new one. Type

      alias 
      

      You will see a list of currently defined aliases - i.e., short-cuts to execute something - and one of them should be vassal. You can now launch VASSAL with

      vassal 
      

      from anywhere.

    • Note, you cannot do

       vassal SomeModule.vmod 
      

    because VASSAL changes the current directory to its installation directory (see also this bug report). You need to give the full path to the module, which is easily done by

      vassal `pwd`/SomeModule.vmod 
    

    Here, the backticks ``evaluates the command pwd (print-working-directory) and puts the result on the command-line before executing the command line.

  • Note you will typically not see the file ~/.bash_aliases when you list files in the current directory

     ls 
    

because the file name starts with a dot .. To see all files, pass the option

    ls -a 
  • The above does not register VASSAL and VASSAL module files as connected. To do that, you need to register a custom mime-type and a handler for that mimetype.

    • To register the mimetype, make the file ~/.local/share/mime/packages/applications-x-vassal.xml with the content

      <?xml version="1.0"?>
      <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
         <mime-type type="application/x-vassal-module">
           <comment>VASSAL module file</comment>
           <glob pattern="*.vmod"/>
         </mime-type>
         <mime-type type="application/x-vassal-log">
           <comment>VASSAL log file</comment>
           <glob pattern="*.vlog"/>
         </mime-type>
         <mime-type type="application/x-vassal-save">
           <comment>VASSAL save file</comment>
           <glob pattern="*.vsav"/>
         </mime-type>
      

    and then run

      update-mime-database 
    
    • Next, create the file ~/.local/share/applications/vassal.desktop with the content

      [Desktop Entry]
      Type=Application
      MimeType=application/x-vassal-module;application/x-vassal-log;application/x-vassal-save
      Name=VASSAL
      Exec=$HOME/applications/VASSAL/VASSAL.sh
      Icon=$HOME/applications/VASSAL/VASSAL.svg
      Actions=Run;Edit;
      
      [Desktop Action Run]
      Name=Run
      Exec=$HOME/applications/VASSAL/VASSAL.sh -l %f
      
      [Desktop Action Edit]
      Name=Edit
      Exec=$HOME/applications/VASSAL/VASSAL.sh -e %f
      

      and run

      update-desktop-database ~/.local/share/applications 
      
      • Note that you may need to replace $HOME above with the path to your home directory. To figure out what that is do

        echo $HOME 
        

      It will typically report something like /home/user name. For the user foo it would typically be

        /home/foo 
      

      and the edit should be

        $HOME/applications/VASSAL/VASSAL.sh -> /home/foo/applications/VASSAL/VASSAL.sh
      
    • Now, you should be able to double-click a VASSAL module, save file, or log file in your favorite file-browser to launch VASSAL with that file. You will also be able to launch VASSAL from your application menu.

@uckelman Perhaps you could distribute the above mime and desktop files with VASSAL?

Ideally, all this would be done for you automatically when you install VASSAL. However, since VASSAL does not come as a distribution package (.deb, .rpm, …) these steps are unfortunately needed for better desktop integration.

Hope the above is useful to some.

Yours,

Christian

Much simpler is:

tar -xvf VASSAL-3.7.6-linux.tar.bz2

Any remotely modern version of tar automatically detects bzip2 compression.

1 Like

There was actually a point to showing how one can pipe-line several small applications into a larger whole. That’s really the power of the command line. But of course, you are right that it is simpler, albeit less pædagogical :smile:

Will you add these small files to the distribution? Perhaps with a script like (named e.g., desktop-integration.sh or something like that)

#!/bin/sh 

dest=/usr/local
mode=install

usage() {
   echo "Usage: $0 [install|uninstall] [--user|--system|--destination PREFIX]"
}

while test $# -gt 0 ; do 
    case $1 in 
     -h|--help)  usage ; exit 0 ;; 
     install) mode=install ;; 
     uninstall) mode=uninstall ;; 
     -u|--user) dest=$HOME/.local ;;
     -s|--system) dest=/usr/local ;; 
     -d|--destination) dest=$2 ; shift ;; 
     *) echo "$0: Unknown argument: $1" ; exit 1 ;; 
    esac
    shift 
done 

if test "x$mode" == "xinstall" ; then
  EXEC_PATH=$(realpath "$0")
  INSTALL_DIR=$(dirname "${EXEC_PATH}")

  sed "s|$$INSTALL_DIR|$INSTALL_DIR|" < vassal.desktop > tmp.desktop
  sed "s|$$INSTALL_DIR|$INSTALL_DIR|" < applications-x-vassal.xml > tmp.xml   
  mkdir -p $dest/applications
  mkdir -p $dest/mime/packages
  mkdir -p $dest/bin
  mv tmp.desktop $dest/applications/vassal.desktop
  mv tmp.xml     $dest/mime/packages/application-x-vassal.xml 
  update-mime-database $dest/mime
  update-desktop-database $dest/
  (cd $dest/bin && ln -s $EXEC_PATH vassal)
else
  rm -f $dest/mime/packages/application-x-vassal.xml
  rm -f $dest/applications/vassal.desktop
  rm -f $dest/bin/vassal
  rmdir -p --ignore-fail-on-non-empty $dest/applications
  rmdir -p --ignore-fail-on-non-empty $dest/mime/packages
  rmdir -p --ignore-fail-on-non-empty $dest/bin
fi

A user can then easily install the integration - either system-wide or for the user only.

Yours,
Christian

It would be preferable to distribute a .deb and a .rpm for people who want them; I suspect hardly anyone would use a desktop integration script manually.

I always learn something when someone more experienced shows a way to do something with a script or in the command line. I described a much simpler way to add Vassal to the menu on Linux Mint Cinnamon earlier in the thread. I assume it would work similarly for others to add a menu entry for Vassal to their Linux laptop or desktop in other distros and desktop environments.