Map a drive from workstation to virtual machine in Azure
Hello Experts
I'm trying to map a drive on my workstation to a virtual machine in Azure. I have the vm set up in Azure along with the VPN connection to Azure. I shared a folder on the vm and called it "Archives". How do I map a drive on my workstation so I can copy files to the shred folder on the vm? My workstation is Windows 7 Pro. VM is Server 2012.
Any help is appreciated.
Thanks,
cja
Cloud ComputingAzureWindows Networking
Last Comment
cja-tech-guy
8/22/2022 - Mon
bbao
first thing you need to make sure the network layer is working as expected. once the VPN is established, are you able to PING the VM in Azure?
if no, does any firewall setting on the VM block you to access the VM?
if yes, we will move on other network settings.
here i assume you know how to share a folder on your local server and access it from your computer. if not, just let me know, i can show you the common steps. generally they are the same steps if you do it on the VM in Azure.
Mahesh
If you have VPN tunnel, this is very much possible
I assume over VPN tunnel, your network and azure network can talk without any restrictions
You should be able to access azure VM over NetBIOS
Ex:
you can map shared drive on your workstation with below command
net use * \\azureserverhostname\archives /persistent:yes
* represents any available drive letter will be pickup
This drive will remain connected as long as you are connected to azure VM over VPN
cja-tech-guy
ASKER
OK. The VPN is working it shows as connected both in Azure portal and on our internal firewall. When I try to map a drive from either the cmd prompt or from Windows using the VM server name and share I get an error that it cannot be found.
When I try mapping a drive to a "storage account" in Azure, I get a prompt to login. I tried using the VM admin username and password, did not work. I also tried using the storage account key, did not work.
Can I map directly to the shared folder on the VM or do I need to map to the storage account. I'm very confused. Any help is appreciated.
have you tried
net use \\azureserverhostname\archives /user:<domain>\username * ? (the "*" is required, it will force the prompt to ask for a password)
Have you tried to use the IP address instead of the name ?
bbao
> using the VM server name and share I get an error that it cannot be found.
better try using IP address instead of name here to determine any DNS or name resolving issue.
did you PING the VM over VPN by name and IP? PINGable? any difference?
cja-tech-guy
ASKER
>better try using IP address instead of name here to determine any DNS or name resolving issue. There are two IPs, public and internal which should I use?
>did you PING the VM over VPN by name and IP? When you say ping over vpn, do you mean just use ping from cmd prompt?
cannot ping from internal or external ip. maybe ping is blocked in Azure. VPN shows as connected
cja-tech-guy
ASKER
I tried net use, name and ip
bbao
internal IP, as it's a VPN connection. external IP doesn't make sense here.
BTW, why two IPs for the VM? do you really mean the VM itself is configured with two IPs, one is public, the other is private?
yea I mean to use the PING command in Command Prompt window.
PING should not be blocked in common practices, for easier troubleshooting. if it is the case, an alternative way is to access other allowed services available on the VM or your local computer. e.g. does the VM have a web server that can be accessed or TELNETed over port 80? just try any way possible to make sure traffic between the two hosts can be measurable.
BTW, is TRACERT allowed in your infrastructure? you really got a great admin hehe. :))
OK. Let's back up for a second. Am I mapping a drive to the share on the VM or to a storage account? I don't know what a "storage account" is. Can you please explain that for me?
I cannot map a drive to the shared folder on the VM using VM machine name or ip, but I can map it to a 'Storage location" in Azure. The issue with connecting to the storage location, is I'm being prompted for a username and password when mapping the drive and the VM admin username/password do not work. I don't know what username and password to use. Any ideas?
> I cannot map a drive to the shared folder on the VM using VM machine name or ip,
> but I can map it to a 'Storage location" in Azure.
what does "it" mean here? the drive, the shared folder, or... the VM?
Mahesh
azure storage location is different concept and not related to shared folder
azure storage location is the location (url) where azure store your VMs data (storage account)
On azure VM open elevated command prompt and run below command to turn off windows firewall 1st
netsh advfirewall set allprofiles state off
Then try to ping azure VM over internal IP, if still its not working it means your local onpremise subnet is not added under local networks in azure site to site tunnel configuration
You need to ensure that local on premise subnets must be added to azure local networks in azure portal under azure network, then only you can talk to azure VM on internal IP back and forth
You never need to connect to azure VM on its public IP from within VPN tunnel, otherwise purpose off VPN tunnel will be defeated
in order to access azure VM on public interface, end points has to be defined in azure VM properties
I don't know what network firewall you are using to configure site to site tunnel, check your tunnel, there must be some issue
Mahesh
When you say "You need to ensure that local on premise subnets must be added to azure local networks in azure portal under azure network, then only you can talk to azure VM on internal IP back and forth" Do you mean my internal ip scheme like 10..1.1.x or do you mean subnet 255.255.x.x? Attached is a screen capture of the Azure VN ip settings, can you tell me if I have the right addresses set up in Azure? We use 10.1.1.x internally.
in order to access azure VM on public interface, end points has to be defined in azure VM properties Please explain this further.
We use a Sonicwall nsa240 and I had Sonicwall support check all settings and they said they are correct.
I will run theses two commands. On azure VM open elevated command prompt and run below command to turn off windows firewall 1st
netsh advfirewall set allprofiles state off
screen shot is missing
I mean network to be added as 10.1.1.0/24 where /24 would represent network subnet mask
If you want to access azure VM / its services such as https / http etc from internet, you have to define end points / network security groups in azure VM properties where communication from internet is allowed to azure VM on those specific ports only
If you have VPN tunnel, you are actually extending the on premise network to azure and hence the traffic flow seamlessly without any restrictions
you have configured site to site VPN tunnel from azure to onpremise network with sonic wall firewall, you should be able to find document from the how to configure site to site VPN tunnel with azure
try below:
turn off azure VM windows firewall by running command in earlier comment
then create one shared folder on azure VM and then try to telnet that VM internal IP on TCP 445 port (SMB) from internal network and you should be able to telnet it, if not there is some problem exists with tunnel as stated in my last comment
cja-tech-guy
ASKER
Here is the screen shot. I will try the new steps you suggested and get back to you.
Thanks,
cja
Mahesh
still no screenshot
use insert image option while attaching screenshot
I created a vm but its internal ip is 100.67.66.54. How do I get it to be in the VPN tunnel range of 10.1.2.0/27? I cannot choose an ip for a vm when creating it.
if no, does any firewall setting on the VM block you to access the VM?
if yes, we will move on other network settings.
here i assume you know how to share a folder on your local server and access it from your computer. if not, just let me know, i can show you the common steps. generally they are the same steps if you do it on the VM in Azure.