How do I start vassal in Linux?

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.

Hi,
Interesting how to. First what is a tar.bz2??
2nd not having any electric i was intrigued when i saw vassal had a linux version. Thought maybe to get an install on a tablet. I believe there are some linux versions on the site. 3 of them i believe. Picked debian for some reason. Was amazed that it installed. Only thing is is the load command is not highlighted. So what does that mean?
So i have linux installed got the tar available but still not able to do the afore mentioned hints.
Since there is a fount of linux info here answer another newbies queries.
If debian isnt going to work which version would be best on a tablet?? Also is android a GUI sitting on linux ?? Any rules of thumb there aside from not doing any root work?
Tks RAy.

Also while i am here and the fount is flowing any chance of a 3D version. If anyone has sketchup someone did SL boards 1,2 and 3. Looks interesting and dangerous and would be ready made for hypercard.
RAy.

TAR is a Tape ARchive - a collection of one or more files into a single file. Sometimes called a tar-ball.

BZ (short for BZip2) is a compressor.

Thus, a file ending in .tar.bz2 is a compressed archive of files. It is similar to a ZIP in that respect.

VASSAL is not particularly well suited on mobile devices because touch gestures are not particularly well supported (right click f.ex.).

Which kind of tablet did you install on? OS?

For tablets, where the command line is probably hidden away, you probably need some app that can handle the tar-ball.

You can install Debian GNU/Linux - or any other Linux distro - on a tablet, but for VASSAL you should probably have an external mouse. Which Linux distro is best suited depends on the tablet. Perhaps search on XDA.

VASSAL for linux is distributed as a Java ARchive JAR and as long as you have Java Runtime Environment JRE installed on the tablet, then you should be able to run it (with the aforementioned caveats). So you need

  • A Linux distro that can run on your tablet
  • And that distro should have JRE

Even though Android is written in Java it is not a real JRE, and the Android Java engine cannot execute VASSAL directly. Also, the kernel of Android is indeed Linux, but it is not exactly like other OSs that uses Linux. All apps are sandboxed and run in the Android Virtual Machine.

If you don’t want to root your tablet, you should see if it is possible to install a Linux distribution as an application on your tablet. Then, you can install VASSAL (and a JRE) into that Linux installation.

If it will work for you, I’m sure a lot of people like to know how you did it. Playing VASSAL games on a tablet would indeed be very nice.

Yours,
Christian

Wow gadzooks more linux back talk than i can handle (HAHA). Might have been a samsung 3 lite. Have to get back to u on that. Got the tar waiting but the load command is not highlighted. So cant try to load anything. But need to unzip the tar. Dont know if i did that or not. If the open or load command is not highlighted whats ur gut tell u?? I had a tab that could do a full sized keyboard. I have one with a touch pad but its logitech and needs a gizmo. Keep the light on for me be back soon with the os info. Be nice if i could do this on a motorola zoom. I do have an att tab that the touch screen is out and needs a mouse but i have one of those PALM like keyboards with a touch pad. All the parts, now the savvy to flog them together. One more query. Java on a tab is that available. Wow almost some light at the end of the tuunel. Tks.
RAy

One more thing. How do u log out???
Tks RAy.

Discussion on tablet etc. moved to this thread to not hijack current discussion.