Installing a Clarion application on Xubuntu using Wine and setting up a nettalk web server (Part 1) - (Part 2) - (Part 3)

The following are step by step instructions for installing Xubuntu and Wine in a Hyper-V VM running on OVH and Local hosted VM’s


Installing xubuntu and wine

Ovh to use static IP you must create a mac address in the OVH control panel

download an iso image.

I used xubuntu minimal for its lightweight desktop gui.

a gui is required for wine to operate properly.


xubuntu-25.10-minimal-amd64.iso

From - Hyper-V or windows admin center

Create a VM

Gen2

Add a virtual switch for the network

I used a 20 GB hard disk

Create Then go to settings

For OVH

Networks → Advanced → Static → Mac Address: Enter mac address here.

Security → Template → Microsoft UEFI Certification Authority

Start Then Connect to the VM

You should now see the xubuntu start screen and a very useful spinning circle.

When startup is complete you will be presented with a desktop

use Install Xubuntu Minimal

Enter the following items and click Next

Language

Keyboard

Do not connect to the internet if you are using OVH as we need to add a setting later. If you are using your local computer you can enter those settings now or a local VM you can enter the settings now.

  • Note: if you do try to enter your settings here for OVH setups, the install and boots will take much longer as the network settings will wait to time out.

Interactive installation

Select xubuntu

Do not install third party software

Erase disk and install Xubuntu

I selected no encryption

Enter credentials - Note - For this install i selected that i do not require a password to log in. This may change later if I get systemd working

Select Region

Install and wait until the system is installed - Take a break, do other work or just watch the very useful progress bar.

Once completed - Use restart now

Press enter to remove the installation media and wait for bootup.

Use your password to log in

Use the upper top left blue circle to start terminal emulation

Note: sudo elevates the command you are using to administrator. This is similar to opening a windows command prompt in admin mode.

The first time you use sudo you will be asked to enter your administrator password


Firewall commands: Just the basics here. Salt to your needs.


sudo ufw allow http

sudo ufw allow https

sudo ufw enable

sudo ufw status

Note: to enable from an ip to a specific port. this example is for ssh


sudo ufw allow from 123.123.123.123 to any port 22 proto tcp

Note: to disable use the following example


sudo ufw deny http


Edit network settings

Use the blue circle and then select all applications and select advanced network settings. Go to the IPV4 tab and enter settings. Then Save

Return to or open a new Terminal window using the blue circle

navigate to /etc/netplan/

note: Linux uses the forward slash rather than the back slash when naming directory structures


cd /etc/netplan

Look for yaml files using ls. The -l option shows date and time etc.


ls -l

there may be several files listed. edit the newest file created by the advanced network utility.

hint. you can type out the enter file name such as


sudo nano 90-NM-XXXXXXXXXXXXX.yaml

or you can type something like


sudo nano 9 <press the tab key to finish the line and then press enter>

But before you edit the file. If you did enter the editor then you can use CTRL-X to exit

Now would be a good time to make a backup copy. Linux uses the cp command


sudo cp xxx.yaml xxx.yaml.bu

hint - you can use the tab key to make this quicker

Now back to editing the file


sudo nano 9 <press the tab key to finish the line and then press enter>

Edit the file to look similar to the file below (note the indentation is critical—use spaces, not tabs):

Leave the line with “Your interface as is” mine is eth0. yours could be different as shown below. the on-link: true line is critical for OVH to work


BEGIN FILE

network:

version: 2

ethernets:

enp3s0: # Your interface name

renderer: NetworkManager

addresses:

- 10.10.10.2/24 # Your static IP

routes:

- to: default

via: 10.10.10.1

on-link: true

END FILE

Use CTRL-X to exit and save the file

Test your network file


sudo netplan try

sudo netplan apply

Test the connection


png www.google.com

Update the system


sudo apt update

sudo apt upgrade

Shutdown Xubuntu

From a terminal window use


sudo apt shutdown now

Or blue circle then orange left arrow then shutdown

This is a good time to consider creating a checkpoint

Start the VM and then connect

Use the blue circle to open a terminal window


sudo apt install wine

sudo apt install winetricks

sudo dpkg --add-architecture i386

sudo apt-get update

sudo apt-get install wine32:i386

now test wine by running the wine configuration program


winecfg

if you get an error. unable to load kernal32.dll then you will need to move your .wine folder which allows wine to rebuild its defaults


sudo mv ~/.wine ~/.wine.old

Try running winecfg again

exit winecfg

test notepad


wine notepad

Exit notepad

some terminal notes


pwd displays the current directory

~/ represents your home directory

if my user is jeff then my home directory is

/home/jeff

I can navigate to this location using both


cd /home/jeff and cd ~/

When uploading files using ssh or other tools it is usually best to transfer files to this directory

The default folder for Wine is


~/.wine

and the windows C: drive is located under


~/.wine/drive_c

upload your windows EXE

now run


wine ~/.wine/drive_c/yourapplicationfolder/yourapplicationname.exe

Now would be a good time to shutdown and create a checkpoint

1 Like

Thanks Jeff. Which version (build) of Ubuntu is this for?

The details mention “Xubuntu 25.10 Minimal” aka Questing Quokka

download an iso image
I used xubuntu minimal for its lightweight desktop gui.
xubuntu-25.10-minimal-amd64.iso

1 Like

Minor update. c: is in ~/.wine/drive_c not c_drive

1 Like

a couple of things I always found useful:

ls -la (similar to ls -l, but shows hidden stuff too)
df -h (shows disk usage in human readable form)
and cat & grep

1 Like

To add some

touch (createa new file)

nano -w /path/to/file (text editor, alternative to vi)

ifconfig (to check ip config, similar to ipconfig in windows)
if not present, un Ubuntu and variants, net-tools can be installed like this
sudo apt install net-tools

sudo (super user do, to elevate temporarily permissions to execute high level commands)

Very useful commands to know. I come from MS Xenix and I hesitate to give out hints when I am not sure if my knowledge from over 20 years ago is still valid. I used fgrep. not sure how that differs from grep.

In a nutshell


    egrep is 100% equivalent to grep -E
    fgrep is 100% equivalent to grep -F

2 Likes

To add to that:
top Show running processes with the active at the top.
less Like more but with paging (q quits it)
du -sh * gives file size. s summarises, h for human sizes

1 Like

Part 2 Uploading and running the web1 nettalk application


Uploading and running the web application

Note: Fire wall rules are in cascading order the following is for information only

sudo ufw status numbered
sudo ufw delete #
sudo ufw allow from xx.xx.xx.xx to any port 22 proto tcp

xx.xx.xx.xx

Start here in a terminal window

sudo dpkg -l openssh-server
sudo apt update
sudo apt install openssh-server
sudo systemctl enable ssh
sudo systemctl start ssh

WinSCP for ssh

I uploaded to /home/myusername/.wine/drive_c

I then navigated in a terminal to that folder

cd ~/.wine/drive_c/web1

I then started web1 using wine

wine web1.exe

Note: My web1 appeared to freeze. I removed all Xml, Json and INI files because the port was already set

At this point you can use something like port 8080 and then open the port using firewall rule. Wine does not allow access to ports 80 and 443. These ports will be forwarded later on.

Open this port for testing

sudo ufw allow 8080

test http:xx.xx.xx.xx:8080

If you cant access your site at this time you may need to reboot

Sudo reboot now

test http:xx.xx.xx.xx:8080

Checkpoint

We want to run our application from its folder so that all pathing will work properly. We need a shell script to do this before we run our web application.

Create a shell file (similar to a batch file) note that Linux is case sensitive when naming directories and files. Since we are in our home directory, we do not need sudo here.

starting from your home folder cd ~/

nano web1.sh
[BEGIN FILE]
cd ~/.wine/drive_c/Web1
wine Web1
[END FILE]

CTRL-X to save

Make the file executable

chmod +x my_script.sh

Test you script by using the following

~/web1.sh

Note: entering web1.sh and pressing enter will not run the script. You must use a path

Now to add the site to the startup section. Use the blue top left circle. Then go to settings and then session and startup.

Click on the Application AutoStart tab

Click add

Enter a name and a description, leave the trigger at login. In command enter

/home/yourusername/web1.sh

Note: if the above does not work I found using the button gave me the correct command line

Now you can save, exit and restart to test that the site loads.

You can also take this opportunity to make another checkpoint

1 Like

Part 3 - Installing the nginx web server for port forwarding


Installing the nginx web server for port forwarding

From the terminal

sudo apt update
sudo apt install nginx
sudo ufw allow http
sudo ufw allow https
systemctl status nginx

q to exit


Setting up reverse proxy rules

cd /etc/nginx/site-available
sudo nano your_domain.com.conf

Note: server_name .your_domain.com; # Shortcut for your_domain.com and *.your_domain.com
Note: server_name your_domain.com www.your_domain.com; # Replace with your domain name or use ‘_’ for any hostname

[BEGIN FILE]
server {
    listen 80;
    listen [::]:80;
    server_name .your_domain.com;

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
[END FILE]

Hint: create this file and upload

sudo cp ~/your_domain.com.conf .

Now create a symbolic link

sudo ln -s /etc/nginx/sites-available/your_domain.com.conf /etc/nginx/sites-enabled/

Then remove the default file. Note: use the full path when removing the following file

sudo rm /etc/nginx/sites-enabled/default

Test the file and correct any errors

sudo nginx -t

For SSL forwarding to port 8443

sudo nano /etc/nginx/nginx.conf

Look for the line include /etc/nginx/sites-enabled/*;. Right below that (outside the http {} bracket), add:

include /etc/nginx/streams-enabled/*;

CTRL-X

Make this new directory

sudo mkdir /etc/nginx/streams-available
sudo mkdit /etc/nginx/streams-enabled
sudo nano /etc/nginx/streams-available/yourdomain.com-ssl.conf
[BEGIN FILE]
stream {
    map $ssl_preread_server_name $backend_name {
        ~^(.*)\.khojant\.com$  app_backend;
        khojant.com            app_backend;
    }

    upstream app_backend {
        server 127.0.0.1:8443;
    }

    server {
        listen 443;
        proxy_pass $backend_name;
        ssl_preread on;
    }
}
[END FILE]

CTRL-X

Now link the file

sudo ln -s /etc/nginx/streams-available/yourdomain.com-ssl.conf /etc/nginx/streams-enabled/

Install the nginx stream package

sudo apt install libnginx-mod-stream

Install the vcruntime

:Note - I said no to the X64 runtime. I have no idea if that makes a difference.

sudo winetricks vcrun2015

Now set your certificate and test

1 Like

I need the AWS s3 classes for one of my applications. I needed wine-mono for this. you can get that here.

https://dl.winehq.org/wine/wine-mono/10.4.1/

and use the command

wine msiexec /i wine-mono-10.4.1-x86.msi