Connect to SQL Server on Linux over the network
1st you need to identify your VM IP address, supposing it is 10.1.1.10

sqlcmd -S 10.1.1.10 -U SA -P "YourPassword"


Either check connectivity between your host and your VM using

ping 10.1.1.10


and/or

telnet 10.1.1.10 1433


Read detailed instructions on Microsoft's link below:

sqlcmd on Linux

Regarding to web connection, there's no guarantee to be able to connect to the VM via web, that imply many aspects.