Jump to content

Recommended Posts

Posted

Good afternoon, 

I'm going to be putting together a new server and I'm considering installing FreeBSD.  Has anyone tried running Vintage Story Server on FreeBSD yet?

  • 2 weeks later...
Posted

I tried by installing dotnet8 and changing the VintagestoryServer.runtimeconfig.json to use version 8, but it looks like it tries using some 32bit libraries, I tried searching for 'kernel32.dll' on my linux server running a server, but couldn't find the file? Heres the error from running it:

I also saw in another post (Linux distros/configurations under which VS is known to run) that openBSD has the same issue by CaffinatedCoder

Quote

Completely broken on OpenBSD. Attempts to load 32-bit libraries instead of 64-bit libraries. Server is also broken on OpenBSD for similar reasons as far as I can tell, but gets a bit further.

Vintagestory version 1.20.5

#dotnet VintagestoryServer.dll --dataPath "/var/vintagestory/data"
Unhandled exception. System.DllNotFoundException: Unable to load shared library 'kernel32.dll' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable: 
Cannot open "/home/vintagestory/server/kernel32.dll.so"
Cannot open "/usr/local/dotnet/shared/Microsoft.NETCore.App/8.0.6/kernel32.dll.so"
Shared object "kernel32.dll.so" not found, required by "dotnet"
Cannot open "/home/vintagestory/server/libkernel32.dll.so"
Cannot open "/usr/local/dotnet/shared/Microsoft.NETCore.App/8.0.6/libkernel32.dll.so"
Shared object "libkernel32.dll.so" not found, required by "dotnet"
Cannot open "/home/vintagestory/server/kernel32.dll"
Cannot open "/usr/local/dotnet/shared/Microsoft.NETCore.App/8.0.6/kernel32.dll"
Shared object "kernel32.dll" not found, required by "dotnet"
Cannot open "/home/vintagestory/server/libkernel32.dll"
Cannot open "/usr/local/dotnet/shared/Microsoft.NETCore.App/8.0.6/libkernel32.dll"
Shared object "libkernel32.dll" not found, required by "dotnet"

   at ConsoleWindowUtil.NativeFunctions.GetStdHandle(Int32 nStdHandle)
   at ConsoleWindowUtil.QuickEditMode(Boolean Enable) in C:\Users\Tyron\Documents\vintagestory\game\VintagestoryLib\Server\ConsoleWindowUtil.cs:line 49
   at Vintagestory.Server.ServerProgram.Main(String[] args) in C:\Users\Tyron\Documents\vintagestory\game\VintagestoryLib\Server\ServerProgram.cs:line 31
   at Vintagestory.ServerLinux.Main(String[] args) in C:\Users\Tyron\Documents\vintagestory\game\VintagestoryServer\Linux\ServerLinux.cs:line 9
Abort trap (core dumped

If you want to run it on FreeBSD now, I would look into using the Linux Compatibility layer

  • 1 year later...
Posted

Hey, in case this is still relevant, or someone else sumbles upon this. I have tried it using the Linux compatability layer and it seems to work. I haven't done any extensive testing, but the server does start and I was able to join it.

I setup the server in a FreeBSD jail, here are some commands that you should be able to copy-paste on a fresh FreeBSD install, and it should "just work", you however likely want to change some things (e.g. changing the jail location from "/jail" to something different). I tested these on x86 with FreeBSD 15.1. I am making use of a debian jail in this case, installing the .NET runtime, and then doing a fairly basic vintage story server setup. I still have to figure out how to get the server auto-starting and auto-stopping upon jail starting/stopping.

# Prepare host
pkg install -y debootstrap

service linux enable
service linux start

# Prepare jail
mkdir /jail
debootstrap trixie /jail

cd /jail/etc
echo "root::0:0::0:0::/root:/bin/bash" > ./master.passwd
pwd_mkdb -d . -p ./master.passwd

# Configure jail
cat <<'EOS' >> /etc/jail.conf
vs-server {
    exec.start = "/bin/true";
    exec.stop = "/bin/true";
    exec.consolelog = "/var/log/jail_console_${name}.log";
    persist;

    allow.raw_sockets;
    allow.mlock; # Required by the .NET runtime, see https://github.com/sec/dotnet-core-freebsd-source-build/issues/24
    exec.clean;

    host.hostname = "${name}";
    path = "/jail";

    # Linux file systems
    mount += "devfs      ${path}/dev      devfs      rw,late                    0  0";
    mount += "tmpfs      ${path}/dev/shm  tmpfs      rw,late,size=1g,mode=1777  0  0";
    mount += "fdescfs    ${path}/dev/fd   fdescfs    rw,late,linrdlnk           0  0";
    mount += "linprocfs  ${path}/proc     linprocfs  rw,late                    0  0";
    mount += "linsysfs   ${path}/sys      linsysfs   rw,late                    0  0";

    # Change this to your own preferences!
    ip4.addr = "192.168.122.220";
    # TODO: IPv6
    interface = "em0";
}
EOS

# Start the jail
service jail enable
service jail start

# 
jexec vs-server /bin/bash

apt update
apt install -y wget

# https://dotnet.microsoft.com/en-us/download
wget https://packages.microsoft.com/config/debian/13/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
apt update
apt install -y dotnet-runtime-10.0

# https://account.vintagestory.at/
wget https://cdn.vintagestory.at/gamefiles/stable/vs_server_linux-x64_1.22.6.tar.gz
mkdir -p /opt/vs-server
tar xzf *.tar.gz -C /opt/vs-server
rm *.tar.gz

useradd -m -s /bin/bash vs-server

mkdir -p /var/opt/vs-server
chown vs-server:vs-server /var/opt/vs-server

su vs-server -c "dotnet /opt/vs-server/VintagestoryServer.dll --dataPath /var/opt/vs-server --genconfig"

nano /var/opt/vs-server/serverconfig.json

exit

PS: I plan on doing further FreeBSD + Vintage Story server testing, I will follow up this reply with the results! ^-^

Posted (edited)

Personal preference. I used to run Linux on my home server, until I heard about FreeBSD. The native ZFS support and their Jails sold me initially. It's just something that doesn't exist on Linux in the same way.

I know that Linux has BTRFS which is very similar to ZFS, however, ZFS feels way more battle-proven than BTRFS. You can also get ZFS working on Linux, but it is much nicer to just have it, instead of needing to build it from source.

I also tried all the common Linux containerization tools (docker, podman, LXC and systemd-nsspawn) and I never really liked them. Docker and Podman feel like a mess that abstracts away a lot of the underlying technology. Great, but also not great. I don't like such abstractions, since things can go wrong and it is generally a pain to fix. Things definitely did go wrong for me with Docker and Podman. I did like LXC and systemd-nsspawn a lot more than Docker and Podman tho, but they still felt wrong in some areas.

That brings me to FreeBSD Jails. It is like LXC, but directly built into the OS. No external tools/programs required, and I really like that.

Edited by floral_petals
Typo
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.