SQL Server - How connect to Guest SQL server on Virtual Box from Host via SSMS - sql

I want to connect to SQL server on VirtualBox VM from Host machine via SSMS and .NET code. Details are as follows
Host: Window 10 Professional
Virtual Box Ver.:5.2.8 r121009 (Qt5.6.2)
Guest: Window 7 Professional(Firewall down)
Network:
Host:Asus Router- DHCP
Guest: Currently on NAT
Each time i try to connect from Host, it fails.
SQL Configuration is as follows,
Services
Protocol
TCPIP Properties
Please help.
thank you
Dheeraj Kumar

I solved it, do below steps
Go to Virtual Box application on Host machine
Now go to settings for Virtual machine
Change Attached To: Bridged Adapter
Now this step is tricky, you may need to choose/try different option here,
select one try to run VM and see if it gets the IP address, if not choose
another and try again
Once VM gets IP, you can connect it from Host

Related

How can I communicate a guest VM to Host using Host-Only Adapter? (Virtual Box)

I'm trying to make a connection from a guest virtual machine (VM) to host. I can from host to the guest VM, but not viceversa.
The context:
I'm trying to gain root access on a CTF VM from VulnHub.com, and I configured the guest VM (the CTF VM) network to Host-Only. Instead, if I choose Bridged Adapter, it works normally, but it means the VM is connected "directly" to my physical network adapter, and I want to avoid that for security reasons.
Some other thing I read is set 2 adapter: NAT and Host-Only, but it gives me only the NAT ip address range (10.0.x.x).
Basically, I want to use netcat to make a connection sending a reverse shell from the guest VM to the host, but I want to make it work with the Host-Only Adapter, not Bridged Adapter. How can I make it work?
I found the problem. It was I xd
Why? Because I was trying to access from the host-only adapter (named vboxnet0 in my machine) to the psysical adapter (a switch router). The host-only is a configuration which isolates the networking between the host machine and the guest virtual machine.
So, the IP (IPv4 address) to communicate from guest to host was specified when I created vboxnet0 on Host Network Manager (VirtualBox 6.1). And IS NOT the one I found using the command ifconfig in Linux.
I hope this can help another newbie who have this misunderstanding.
(Pro-Tip: Learn more about networking)

Trying to connect to the pfsence web interface

I have installed and set up pfsence on virtual box and it is booting up properly and seems to be working fine. My problems are:
When I tried to ping the LAN IP from my computer's command prompt it does not receive the packets but if i ping it from inside the virtual machine using pfsence then it returns packets.
Also if I try the IP in the browser it does not take me to the pfsence interface. I used all defaults when installing the the pfsence.
Any suggestions will be welcomed
LAN IP - 192.168.20.20
pfsence version - 2.4.5
This means that you are unable to route into the VM from your computer. What is the Network Adapter for your VM attached to in your VirtualBox settings? If you configure it with a NAT you can achieve your desired configuration.
https://www.virtualbox.org/manual/ch06.html#network_nat

Cant connect sql server from another computer

Currently, I am using SQL server 2012 and running in window 7 64 bit.
My question is
How can I connect this server from another computer (window 10 64
bit)?
What have I done?
My server name is NB-1608-001\SQLEXPRESS2 and I already enable TCP/IP status and Name Pipes status and Shared Memory status
I already set TCP port 1433 for IP4 and IPAll.
I already enable "Allow remote connection to this server" for this server
I already enable "SQL Server and Windows Authentication mode"
The two computer are on the same network
I created UDL file in window 10 computer (I set server name to :"\NB-1608-001\SQLEXPRESS2")and try to connect to sql server but this say:
Test connection failed because of an error in initializing provider :
Unspecified error
After searching some solution on google,
I created InBound and Outbound rule for IP 1433 in Window 7 Computer
But it's still not working.
I tried another way for make sure whether this two computer is connected or not.
I typed "\NB-1608-001" in network and this said
Windows cannot access \NB-1608-001
After Diagnose,It said
file and print sharing resource (NB-1608-001) is online but isnt
responding to connection attempts.
So I assume the two computers are connected.
Is there still another solution?
My main reason is to run the c# app and connect to another computer's SQL server.
Thanks
(some notes: 1433 is a TCP port not an IP, you have to put two backslash \\ for UNC path but maybe this is a StackOverflow escape problem)
I suggest to disable the firewall just for testing purpose to all firewall profiles (maybe you set inbound rule only for private profile and your network is flagged as public).
I would try a ping to the machine name to be sure that its name is resolved by the client.
I would check in the Sql server Configuration manager that TCP client protocols is enabled for both SQL Native clients (32 and 64bit) and TCP/IP under Protocols Network Configuration.
You did not say what is your client, I would try to connect with SQL Server Management Studio, just to be sure this is not a problem related to your client.
This reading can be useful:
https://blogs.msdn.microsoft.com/sqlexpress/2005/05/05/how-to-configure-express-to-accept-remote-connections/

Setting static IP address in Hana Express Edition

I have installed at work SAP Hana Express Edition 2.0 in my laptop. It runs on VMware/Suse. I also set up a static IP address so I don't have to change the client connections. This works fine when I'm at work.
I added the following to hosts file:
192.168.1.85 hxehost
Problem is that when I take my laptop somewhere else all my client connections time out. I checked the IP address in Suse and it's the one I assigned. How to fix this problem?
If I disconnect the laptop from the Internet, I get the following error:
JDBC: Cannot connect to jdbc:sap://192.168.1.85:39013/ [Cannot connect to
host 192.168.1.85:39013 [No route to host: connect],
This is my setup:
How you connect to the virtual machine's IP ports depends on the setup chosen for the VM networking.
The address 192.168.1.85 is part of the 192.168.1.x network, which is very popular for home-router setup and small LANs. It's very likely that your laptop is part of such a network, when not at work. So when you ping the address the laptop uses the network interface that is linked to this network (e.g. your wifi adapter) to look for the host with IP 192.168.1.85. Whoever host currently got the 85 in your network, it's likely not your virtual machine.
One easy way to avoid this is to setup the virtual machine with host-only network. For that you have to configure the network adapter in VMware (or whatever hypervisor you use) to use the host-only network and assign an IP address in a different subnet e.g. in 192.168.5.x. For the HANA client software on your computer, the address to use would, of course, be 192.168.5.85 but it would be stable across all networks your laptop may log into.

simple question about port 80 on ec2 virtual Windows Server

I set up a Windows 2008 Server virtual machine on Amazon ec2. I gave it a "security group" that includes HTTP 80.
I installed GlassFish server and have it listening on port 80.
I can Remote Desktop to the machine (ec2-174-129-128-105.compute-1.amazonaws.com), open a browser, and browse to "http://localhost:80" and see the GlassFish welcome page.
However, when I attempt to browse to the machine from my local laptop like so ...
http://ec2-174-129-128-105.compute-1.amazonaws.com:80
... it just times out.
Any idea what I have to do to open the machine to browsing from the internet? Or what I'm doing wrong?
Thanks,
rob
Answering my own question. I had to open port 80 on the windows firewall. It turns out Windows Server 2008 is locked down excessively tightly out of the box.
try to give the ip address of the machine instead of
http://{your ip address}:80
and see if it works