Page 1 of 1

Issue to access shared path of Guest VM

Posted: 10. Dec 2021, 05:06
by HuaMin
Hi,
Guest VM is with NAT having IPs below. How to access its shared path based on such IPs from the host?
8h.png
8h.png (50.02 KiB) Viewed 6132 times

Re: Issue to access shared path of Guest VM

Posted: 10. Dec 2021, 16:24
by scottgus1
enp0s8 is getting a Virtualbox NAT IP address. NAT acts like a typical house router between the host and the VM, see Virtualbox Networks: In Pictures: NAT.

You'd have to open ports in NAT's Port Forwarding (see the Advanced dropdown in the NAT adapter settings). You should web-search what ports to open to access a shared folder on the VM OS.

It would be easier to use a Host-Only or Bridged network, then Virtualbox would have no ports that require opening. The VM OS may need its own settings in its firewall.

emp0s3 has an APIPA address, self-selected by the VM OS, because it is looking for a DHCP server on that network and it cannot find one. What kind of Virtualbox network is being connected for enp0s3?

Re: Issue to access shared path of Guest VM

Posted: 10. Dec 2021, 16:51
by HuaMin
Thanks. I've selected Host-only adapter on guest VM. How to access VM's shared path from the host? Guest VM is with IP like 192.168.56.101. But I cannot refer to its path using "\\192.168.56.101\sh_path".

Re: Issue to access shared path of Guest VM

Posted: 10. Dec 2021, 19:27
by scottgus1
If enp0s3 was the Host Only adapter and is still showing the 169.254 address then the VM OS's configuration of the Host-Only adapter is not responding correctly, or the Host Only network is not set up correctly.

If enp0s3 is now showing the 192.168.56.101 address, then try pinging 192.168.56.101 from the host OS. The VM OS's firewall should be opened to allow ping.

If the ping works, then you should be able to web-search how to access a shared folder on a Linux OS from a Windows OS. And the address 192.168.56.101 would be the Linux OS's "server" address in Windows.

Re: Issue to access shared path of Guest VM

Posted: 11. Dec 2021, 05:15
by HuaMin
There is already shared path on guest below

\\192.168.56.101\sh_path

Within host OS, I can ping 192.168.56.101 well. Why can't I access it from Host OS?

Re: Issue to access shared path of Guest VM

Posted: 11. Dec 2021, 15:05
by scottgus1
Since you can ping, the Virtualbox network is working. Now you need to web-search how to share a Linux folder so that a networked Windows OS can access it. This is a question for Linux and Windows help channels now. Virtualbox has done all it can do.

Re: Issue to access shared path of Guest VM

Posted: 12. Dec 2021, 09:48
by HuaMin
I have set up Samba to share path within this VM. In the past, I could access it via

\\113.255.251.156\sh_path

Now even if it is having Host-Only adapter, I cannot access it via

\\192.168.56.101\sh_path

How to resolve it?

Re: Issue to access shared path of Guest VM

Posted: 12. Dec 2021, 15:28
by scottgus1
Please right-click the VM in the main Virtualbox window's VM list, choose Show in Explorer/Finder/File Manager. Zip the VM's .vbox file (not the .vbox-prev file), and post the zip file, using the forum's Upload Attachment tab. (Configure your host OS to show all extensions if the folder that opens does not show a .vbox file.)

In the Windows OS, open a Command Prompt and run ipconfig /all. Post the command output.

In the Linux OS, open a Terminal and run ifconfig or ip address. Post the command output.

Re: Issue to access shared path of Guest VM

Posted: 13. Dec 2021, 04:25
by HuaMin
Thanks a lot. Please see .vbox file, and IP details on both Win host and Ubuntu guest.
8p.png
8p.png (19.8 KiB) Viewed 5935 times
8o.png
8o.png (112.85 KiB) Viewed 5935 times

Re: Issue to access shared path of Guest VM

Posted: 13. Dec 2021, 15:13
by scottgus1
Everything is working correctly in Virtualbox. The host-only network is connected and you can ping.

This is not a Virtualbox problem. You should pretend the host and VM are two real computers with a network between them, and solve by asking Microsoft and Linux forums how to get Windows to see a Linux shared folder.

Re: Issue to access shared path of Guest VM

Posted: 13. Dec 2021, 15:59
by HuaMin
If there is one shared path like

\\my.own.ip.addr\sh_path

how to access it within Ubuntu?

Re: Issue to access shared path of Guest VM

Posted: 13. Dec 2021, 17:35
by scottgus1
Inside the VM you can access Windows shared folders at 192.168.56.1

Inside Windows you can access Ubuntu shared folders at 192.168.56.101

Anything else after that is beyond Virtualbox:
scottgus1 wrote:asking Microsoft and Linux forums how to get Windows to see a Linux shared folder.

Re: Issue to access shared path of Guest VM

Posted: 14. Dec 2021, 03:30
by HuaMin
Inside the VM you can access Windows shared folders at 192.168.56.1
Thanks. Within VM, how to directly access this IP?

Re: Issue to access shared path of Guest VM

Posted: 14. Dec 2021, 04:24
by scottgus1
These questions are about how to use an operating system, not about how to use Virtualbox. We help with how to use Virtualbox here, not with how to use operating systems. Ask the Linux folks.