Skip to content

Vagrant configuration of Linux VM for hassle-free fun with SQL Server 2017

Notifications You must be signed in to change notification settings

mloskot/vagrant-sqlserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Vagrant SQL Server 2017 on Ubuntu Linux

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

Features

  • 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 password vagrant
    • Port forwarding from host 2433 to guest 1433 (default).
      • Hyper-V: No port forwarding configured - default port used.
    • Database user sa with password Password123.
    • Database master.
    • Set SQL Server edition to Developer with MSSQL_PID="Developer.
    • Other of configuration Environment variable set to default.

Requirements

  • Hyper-V enabled or VirtualBox installed.
  • Vagrant installed.

Installation

  • git clone this repository or download ZIP.
  • cd vagrant-sqlserver
  • Follow the Usage section.

Usage

Vagrant VM

  • 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.

SQL Server

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;"

About

Vagrant configuration of Linux VM for hassle-free fun with SQL Server 2017

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages