Installing SQL Server 2022 on a MintOS Linux VM is a smart move if you’re looking to combine the stability of Linux with the power and performance of Microsoft SQL Server. This guide provides a seamless, step-by-step walkthrough on setting up SQL Server 2022 in a MintOS virtual environment and accessing it through SQL Server Management Studio (SSMS). Whether you’re a database administrator, developer, or a student looking to practice, this guide will help you get up and running without confusion.
Why Install SQL Server 2022 on Linux?
Microsoft SQL Server has traditionally been associated with the Windows ecosystem. However, since SQL Server 2017, Microsoft has made SQL Server available on Linux distributions, offering the same performance and features. SQL Server 2022 builds on that vision with better scalability, enhanced security, and deep integration with cloud platforms.
Linux offers better performance in many cases, reduced licensing costs, and lower overhead. MintOS, based on Ubuntu, is a user-friendly distribution that’s easy to use even for beginners. Running it inside a virtual machine provides an isolated environment, ideal for development, testing, or training purposes.
Prerequisites
Before beginning the installation, ensure you have the following:
A MintOS virtual machine (based on Ubuntu 20.04 or later)
Sudo privileges
Internet access
At least 4 GB RAM (recommended for SQL Server)
Optionally, a Windows machine to install and use SSMS
This guide assumes your MintOS VM is already installed and running.
Step 1: Update the System
The first step is to update your system to ensure all packages and dependencies are current.
Open your terminal and run:
sudo apt update && sudo apt upgrade -y
This will refresh the package index and upgrade all installed packages to their latest versions.
Step 2: Install SQL Server 2022
2.1 Import Microsoft GPG Key
Microsoft’s official GPG key is required to verify package authenticity.
Run the following command:
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
2.2 Register the SQL Server Repository
Next, add the Microsoft SQL Server repository for Ubuntu 20.04 to your system.
Run:
sudo add-apt-repository “$(wget -qO- https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-2022.list)"
2.3 Install SQL Server
Now, install the SQL Server 2022 package.
Run the following:
sudo apt update
sudo apt install -y mssql-server
2.4 Configure SQL Server
Once installation is complete, configure SQL Server using the setup script:
sudo /opt/mssql/bin/mssql-conf setup
During the setup, you will be asked to:
Choose the edition (e.g., Developer, Express, Evaluation, or Enterprise)
Accept the license terms
Set a strong password for the ‘sa’ (system administrator) account
2.5 Start and Enable SQL Server
After configuration, verify the SQL Server service is running:
systemctl status mssql-server
If it is not running, start it with:
sudo systemctl start mssql-server
To ensure SQL Server starts on boot, run:
sudo systemctl enable mssql-server
At this point, SQL Server is successfully installed and running on your MintOS VM.
Step 3: Install SQL Server Command-Line Tools
Microsoft provides command-line utilities such as sqlcmd and bcp for managing SQL Server from the terminal.
3.1 Add the Tools Repository
Add the repository for Microsoft’s tools:
sudo add-apt-repository “$(wget -qO- https://packages.microsoft.com/config/ubuntu/20.04/prod.list)"
3.2 Install the Tools
Update your package list and install the tools:
sudo apt update
sudo apt install -y mssql-tools unixodbc-dev
3.3 Add Tools to Your System PATH
To use sqlcmd and bcp from any location in the terminal, add them to your PATH:
echo ‘export PATH=”$PATH:/opt/mssql-tools/bin”’ >> ~/.bashrc
source ~/.bashrc
Step 4: Connect to SQL Server via Terminal
Now that SQL Server and the tools are installed, you can connect to the server using sqlcmd.
Run:
sqlcmd -S localhost -U sa -P ‘YourStrongPassword’
Replace 'YourStrongPassword' with the password you set during the setup. If the connection is successful, you will enter the SQL command shell where the prompt changes to 1>, indicating that the server is ready to accept SQL commands.
To exit, type:
QUIT
Step 5: Install SQL Server Management Studio (SSMS) on Windows
While SQL Server runs well on Linux, the full graphical interface provided by SSMS is only available on Windows. SSMS allows for intuitive database management, query execution, and performance monitoring.
5.1 Download SSMS
Visit Microsoft’s official page to download the latest version of SSMS:
https://aka.ms/ssmsfullsetup
5.2 Install SSMS
Run the installer and follow the on-screen instructions. Once installed, launch SSMS.
5.3 Connect SSMS to Your Linux VM
To connect from SSMS to your MintOS-hosted SQL Server:
Open SSMS and click “Connect” -> “Database Engine”.
For the Server name, enter the IP address of your MintOS VM, followed by the port 1433. For example: 192.168.1.100,1433
Choose SQL Server Authentication.
Enter the sa username and the password you configured.
Click Connect.
If the connection fails, make sure that:
Port 1433 is open in your VM’s network settings
Your firewall allows traffic on port 1433
SQL Server is running
Step 6: Test and Verify
Once connected, try running a simple query to test the setup:
SELECT @@VERSION;
This should return information about the SQL Server version and confirm that everything is working as expected.
Conclusion
Setting up SQL Server 2022 on MintOS is a straightforward process if you follow the correct steps. With Linux’s stability and SQL Server’s powerful features, this combination is ideal for development, learning, and production use. You now have the ability to connect through both terminal-based tools and SSMS, giving you flexibility depending on your workflow.
This guide covered everything from updating the system, installing SQL Server, configuring it, adding command-line tools, and finally using SSMS from a Windows host machine. Whether you’re managing large databases or just experimenting, you’re now equipped to make the most of SQL Server 2022 on Linux.
For future posts, we’ll explore advanced topics like backups, high availability, monitoring performance, and connecting SQL Server with cloud services like Azure.
If you found this guide useful, consider bookmarking it and sharing it with your team or community.
0 Comments