Installing TeamSpeak into Jail

Installing TeamSpeak into Jail

Here is a guide to install TeamSpeak port into Jail.
For update process see the bottom of this guide

  • (Optional) Create teamspeak user and group in FreeNAS GUI. Disable the password and set the shell to /nologin and home directory to /nonexistent. This is only "mapping" user between host system and Jail.
1580684588210.png

1580684588250.png

1580684588289.png

  • Create new "Default (Clone Jail)" + configure network and VLAN as per your need.
  • Start the jail and connect to the Jail shell
jls jexec # tcsh
  • (Optional) Manually create teamspeak group and user with matching UID and GID as created in FreeNAS GUI
pw groupadd teamspeak -g 1054 adduser

Username: teamspeak
Full name: teamspeak
Uid (Leave empty for default): 1054
Login group [teamspeak]:
Login group is teamspeak. Invite teamspeak into other groups? []:
Login class [default]:
Shell (sh csh tcsh nologin) [sh]:
Home directory [/home/teamspeak]:
Home directory permissions (Leave empty for default):
Use password-based authentication? [yes]: no
Lock out the account after creation? [no]:
Username : teamspeak
Password : <disabled>
Full Name : teamspeak
Uid : 1054
Class :
Groups : teamspeak
Home : /home/teamspeak
Home Mode :
Shell : /bin/sh
Locked : no
OK? (yes/no): yes
adduser: INFO: Successfully added (teamspeak) to the user database.
Add another user? (yes/no): no
Goodbye!
  • enable/update package management
pkg update pkg upgrade portsnap fetch portsnap extract portsnap fetch update
  • In case you're still on FreeNAS 11.3.x override the unsupported FreeBSD version (because FreeBSD 11.3 is out of life)
setenv ALLOW_UNSUPPORTED_SYSTEM yes

cd /usr/ports/audio/teamspeak3-server/ make install clean
//There will be few compile-selection prompts. Un-Tick any "Examples", "Documentation" and "Manuals" as they're not necessary. Leave the rest.
//Compile for each of dependent package will take a while
  • vi /etc/rc.conf and add following lines
# Enable TeamSpeak
teamspeak_enable="YES"

  • Start teamspeak in order to init DB and environment + generate privilege key
service teamspeak start
  • Get the generated token from init logs.
cat /var/log/teamspeak/ts3server*

1580684588330.png

  • Connect to TS and enter the token to pop-up window. Your user will be granted with Server-Admin privileges

  • (optional) Change listening port of TS server
service teamspeak stop
#From FreeNAS HOST system (not from jail!), replace with proper path and port
cd /mnt/<poolname>/iocage/jails/<teamspeak_jail_name>/root/var/db/teamspeak sqlite3 ts3server.sqlitedb update servers set server_port=##### where server_id=1; quit
#From TS Jail again
service teamspeak start

Grant ServerQuery group to client
// Note that this is not officially supported anymore for security reasons (the old "tokenadd tokentype=0 tokenid1=2 tokenid2=0" will NOT work). Following "hack" is required.
  • Connect to TS server as user with ServerAdmin rights and select Permissions -> Privilege Keys
1580684588371.png

  • Click "Create" and select "Type: Server Group" , "Group: Admin" and "Description: SQ"
  • Click "Create" and COPY the generated key somewhere. It will be required later on
1580684588415.png

  • Change associated group of the token
service teamspeak stop
#From FreeNAS HOST system (not from jail!)
cd /mnt/<poolname>/iocage/jails/<teamspeak_jail_name>/root/var/db/teamspeak sqlite3 ts3server.sqlitedb update tokens set token_id1=2 where token_description='SQ'; quit
#From TS Jail again
service teamspeak start
  • Connect to TS server again and select Permissions -> Use Privilege Key
  • Use the key previously generated and confirm
  • User gets ServerQuery permission
1580684588453.png

  • Now select Tools -> ServerQuery Login
1580684588490.png

  • Select different (!!) username than the one you're using for TS connection otherwise it will be in conflict.
  • Confirm and you will get generated password - save these.

  • You can use YaTQA GUI for ServerQuery. Use the Login and generated password in the red-boxes bellow.
  • If you've changed the default TS server port to something else fill the "Port (optional)" field as well.
1580684588546.png

  • To change the ServerQuery listening port
service teamspeak stop echo "query_port=11111" >> /usr/local/etc/teamspeak/ts3server.ini service teamspeak start
  • In order to use non-standard ServerQuery port in YaTQA it has to be allowed in Settings. Then enter proper port number to "Query port" field.
1580684588594.png


DONE!

UPDATE of TeamSpeak with preserving the configuration
In case you're still on FreeNAS 11.3.x override the unsupported FreeBSD version (because FreeBSD 11.3 is out of life)
setenv ALLOW_UNSUPPORTED_SYSTEM yes

Code:
pkg update
pkg upgrade
portsnap fetch
portsnap fetch update
portsnap extract
cd /usr/ports/audio/teamspeak3-server/
make reinstall
service teamspeak start
Author
HolyK
Views
8,238
First release
Last update
Rating
5.00 star(s) 1 ratings

Latest reviews

This was easy to follow and got my TeamSpeak server up and running very quickly. Including the process for updating the server is also very much appreciated.
Thanks!
Top