Vagrant configuration to provide users with virtual environment for hassle-free fun with SQL Server 2017.
Looking for SQL Server 2017 on Windows VM? Check https://github.com/mloskot/vagrant-sqlserver-windows
Looking for SQL Server on Windows VM? Check https://github.com/msabramo/vagrant_sql_server_express
- Ubuntu 16.04
- Hyper-V or VirtualBox
- SQL Server 2017 on Linux (official packages by Microsoft)
- SQL Server command-line tools on Linux
- Pre-configured with
- Vagrant default user:
vagrant
with passwordvagrant
- Port forwarding from host
2433
to guest1433
(default).- Hyper-V: No port forwarding configured - default port used.
- Database user
sa
with passwordPassword123
. - Database
master
. - Set SQL Server edition to
Developer
withMSSQL_PID="Developer
. - Other of configuration Environment variable set to default.
- Vagrant default user:
- Hyper-V enabled or VirtualBox installed.
- Vagrant installed.
git clone
this repository or download ZIP.cd vagrant-sqlserver
- Follow the Usage section.
vagrant up
- create and boot the guest virtual machine.
First time run, this may take quite a while as the base box image is downloaded and provisioned, packages installed.
On Hyper-V, by default, Default Switch
is preferred. If you prefer to select different switch, see related comment in the Vagrantfile
.
On Hyper-V, no port forwarding is enabled. Once the provisioning is done, IP address of the guest is printed. Use this IP to connect from host to the SQL Server using the default port.
vagrant ssh
- access the guest shell via SSH.
You'll be connected as the vagrant user.
You can get root access with sudo
command.
-
vagrant halt
- shutdown the guest machine. -
vagrant destroy
- wipe out the guest machine completely.
Using sqlcmd:
- Connect to SQL Server instance from inside the guest VM
vagrant ssh
sqlcmd -S localhost -U SA -P 'Password123' -Q "SELECT @@version;"
sqlcmd -S localhost -U SA -P 'Password123' -Q "SELECT name FROM sys.databases;"
- Connect to SQL Server instance from host
sqlcmd -S localhost,2433 -U SA -P 'Password123' -Q "SELECT name FROM sys.databases;"