Runing on Linux under WINE

This was asked in a thread a while back but with no luck…

I have already successfully moved my MS-SQL server to a Debian server which is working great thanks to Microsoft’s new found love for Linux.

I would love to be able to run my POS terminals on Linux, but to do so I would need to get SambaPOS running under WINE.

Using Ubuntu 18.04 I have added 32-bit wine and thanks to winetricks I have successfully installed the .NET Framework 4.6.2

I have also been able to install SambaPOS 5 but unfortunately it does not seem to run correctly…

If I launch without a connection string to my SQL server (should use a text file DB because LocalDB is not installed) then everything works fine. I am presented with the login screen, but when I login with “1234” there is no menu displayed and right-clicking does not give the orange bottom menu:

If I launch with a connection string to my SQL server (should use a text file DB because LocalDB is not installed) then I never get to the point where the login screen is displayed since the DB fails to connect. If anyone has any experience of running .NET SQL clients in WINE I would love to know if you have nay tips.

Top-level Exception

Type:        System.Data.SqlClient.SqlException

Message:     A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Source:      .Net SqlClient Data Provider

Stack Trace: at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling)
   at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
   at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.Open()
   at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.<Open>b__36(DbConnection t, DbConnectionInterceptionContext c)
   at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
   at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection connection, DbInterceptionContext interceptionContext)
   at System.Data.Entity.SqlServer.SqlProviderServices.<>c__DisplayClass33.<UsingConnection>b__32()
   at System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute(Action operation)
   at System.Data.Entity.SqlServer.SqlProviderServices.UsingConnection(DbConnection sqlConnection, Action`1 act)
   at System.Data.Entity.SqlServer.SqlProviderServices.UsingMasterConnection(DbConnection sqlConnection, Action`1 act)
   at System.Data.Entity.SqlServer.SqlProviderServices.CreateDatabaseFromScript(Nullable`1 commandTimeout, DbConnection sqlConnection, String createDatabaseScript)
   at System.Data.Entity.SqlServer.SqlProviderServices.DbCreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection)
   at System.Data.Entity.Core.Common.DbProviderServices.CreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection)
   at System.Data.Entity.Core.Objects.ObjectContext.CreateDatabase()
   at System.Data.Entity.Migrations.Utilities.DatabaseCreator.Create(DbConnection connection)
   at System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(Action mustSucceedToKeepDatabase)
   at System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration)
   at System.Data.Entity.Internal.DatabaseCreator.CreateDatabase(InternalContext internalContext, Func`3 createMigrator, ObjectContext objectContext)
   at System.Data.Entity.Internal.InternalContext.CreateDatabase(ObjectContext objectContext, DatabaseExistenceState existenceState)
   at System.Data.Entity.Database.Create(DatabaseExistenceState existenceState)
   at Samba.Persistance.Data.Initializer.Create(CommonDbContext context)
   at Samba.Persistance.Data.Initializer.InitializeDatabase(DataContext context)
   at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf`1.<CreateInitializationAction>b__e()
   at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
   at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
   at System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c)
   at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()
   at System.Data.Entity.Internal.InternalContext.ForceOSpaceLoadingForKnownEntityTypes()
   at System.Data.Entity.DbContext.System.Data.Entity.Infrastructure.IObjectContextAdapter.get_ObjectContext()
   at Samba.Infrastructure.Data.SqlData.EFWorkspace..ctor(CommonDbContext context)
   at Samba.Persistance.Data.WorkspaceFactory.Create()
   at Samba.Presentation.Services.Common.DataGeneration.DataCreationService.get_Workspace()
   at Samba.Presentation.Services.Common.DataGeneration.DataCreationService.ShouldCreateData()
   at Samba.Presentation.Services.Common.DataGeneration.DataCreationService.CreateData()
   at Samba.Presentation.Bootstrapper.InitializeShell()

Inner Exception 1

Type:        System.ComponentModel.Win32Exception
Message:     Path not found

Good news!

Following @markjw’s tip-off I installed a non-beta version of SambaPOS and the text-based DB loaded perfectly… So it is possible to get pretty far with running SambaPOS in WINE under Linux.

Does anyone else have any tips on connecting to SQL DBs from within .NET applications running within WINE?

seems like a lot of work just to run SambaPOS. What would be the advantage?

1 Like

No Windows license to pay?

1 Like

I guess lol. I just dont see the cost effectiveness. Wouldnt this complicate simple things like setting up printers?

For me…

  • No licensing costs
  • Not having all the latest windows telemetry going on
  • Updates are a lot more predictable
  • Could more easily look in to disk-less PXE LAN booting solutions for terminals

I haven’t tried yet, but according to Wne documentation if you can set-up a printer to work from your native Linux desktop then that same printer will automagically be exposed to the Wine environment.

We receive a similar error on windows when there is a firewall or tcp port configuration issue. btw there is a Path not Found error at the end but I’m not sure what it is as error report probably got truncated.

I am able to connect to the SQL server using a native linux app on the same machine and I have been able to access the internet (and therefore my local network) from other applications running in Wine.

What I haven’t been able to check is any other .NET application connecting to the internet or an SQL server from within Wine can anyone this of any free .NET apps which I could try out to check network connectivity within the .NET framework?

this begged my question…

will it run entirely on Raspberry pi ?


1.4GHz 64-bit quad-core processor, dual-band wireless LAN, Bluetooth 4.2/BLE, faster Ethernet, and Power-over-Ethernet support (with separate PoE HAT)

Think you’ll be pushing your luck on a pi, latest ones I think can run Windows anyway but I certainly wouldn’t expect it to be overly rapid. Might be wrong.
You would be better looking at something like QMX and running it through browser is PI is direction you wanted to take.

1 Like

I had some time on my hands and there has been a lot of news about improvments to WINE recently, with many PC games now reportedly working well in WINE.

I managed to get it working nicely with wine-devel (4.3). I installed dotnet462 and corefonts using WineTricks and then just went ahead and installed SambaPOS using the setup.exe

This time around I was able to successfully connect to my SQL server (I probably made a silly mistake before).

Everything seems good, except…

As far as I can tell rule contraints are completely ignored…
In the example below both 1==1 and 1==2 are both validated as true and both actions run.

I know I should probably just dive up on this, but I’d love to be able to ditch Windows if possible. Can anyone think why this one specific part of the application would be giving such a different result?

@Tayfun - I guess there is not chance that you guys will be releasing a purely Linux based release any time soon? A Linux targeted release that could run natively on mono or maybe .NET Core would be amazing!

But those are action constraints… is the rule custom constraint not working either?

Try setting a command value of True to that command. Then type '[:CommandValue]' != 'True'

See if it works.

We don’t have a development plan for Linux in near future.


I tried that. The CommandValue comes through fine, but again the constraint seems to be ignored.

I tried 'A' != 'A' but that also validated as true.

It’s a shame, I was really excitied to see it working in Linux… I guess maybe it might always be abit flakey… It’s just frustrating, because I kind of feel we’re so close!

.Net Core havent same functions with .Net now. Also we use other techs like WPF and i think Microsoft cant implement this to .Net Core.
So we havent any plan for a Linux client

@mjb2000 out of curiosity what is your primary reason for using Linux.

1 Like

Ah, fair enough. That makes sense.

My main reasons are…

  • I would like to use more terminals without paying Windows license fees (I have some old hardware that would run a lightweight Linux distro nicely, but would be a bit slow running Windows 10)
  • Updates could be delivered more consistantly. No more trying to leave my shop (and turn off the mains power) but having to stay because Bill Gates has decided I should wait a while for an update to be installed
  • I would like to run a Virtual Machine on my on-site server (that runs 24/7) to allow my accountant remote access to SambaPOS. At the moment she has a VPN for SambaPOS on her laptop to access the on-site SQL DB, but the experience isn’t great, particularly for reports. The Windows 10 license does not permit being installed on a Virtual Machine for solely remote access (I should be using Windows Server which is much more expensive).
  • I would like to standardise all the desktops around the shop using a single image and boot via PXE Network Boot. This would mean I don’t need to use hard drives in the terminals. (This is possible with windows but very clunky, a Windows Server or some other 3rd party proprietary software is required)
  • SambaPOS is the only application we use that requires Windows. The rest of of business tools are platform agnostic.
  • I like using Linux, I use it throughout my business, it runs my
    • Virtualisation server hosting many other virtual machines (Proxmox)
    • Firewall/Router/Load balancer/OpenVPN server (pfSesne - OK BSD, not Linux, but close enough)
    • Phone sysem with enterprise style features (FreePBX)
    • SambaPOS database (CentOS running ms-sql-server)
    • RAID File sharing and backup server, which is then backed up to another offsite system (FreeNAS - BSD again)
    • Internal web server that shows our dive planner by querying the SambaPOS data and displaying it in an intuitive way (Ubuntu wuth Apache+PHP7)
    • CCTV capture server which takes snapshots of the CCTV cameras when a ticket is settled or cash drawer opened in SambaPOS (helps to track down issues when money is missing at the end of the day) (Ubuntu+Apache+PHP7+ffmpeg)

:arrow_up: All of the above run on a single low power 8 core system which uses hardly any power:

  • Intel Atom C3758 SuperMicro board
  • 32GB ECC RAM (FreeNAS likes a good amount of memory)
  • 1x 250GB SSD boot drive
  • 3x 8TB HDDs (ina RAID-Z1 array)
  • 3x 3TB HDDs (Another RAID-Z1 array)

Hmmm… After re-reading this, maybe I should also add “because I’m a geek” to that original list!!!


LOL, is that a legit term, love it, made my day.

1 Like

Didnt get that impression at all :stuck_out_tongue:

1 Like