VMware Communities
Shakmatt
Contributor
Contributor

connecting via a virtual switch

Ello all:)

I have used vmware a little bit but i am un-sure of how the networking side of it works.

Here is what i want to do. I have a virtual machine that is connecting to my sftp server on the same pc but it is doing it through the public ip or a domain name i setup. I would rather have it connect through a virtual lan, basically if i remove my physical switch and router, i would still be able to connect to the sftp server.

is this the default behavior of vmware? or do i need to set up the network differently?

thanks

Tags (2)
8 Replies
a_p_
Leadership
Leadership

VMware Workstation basically provides 3 different network options for VMs:

  • Bridged - VM gets an IP address from the physical network, can reach external systems, and can be reached directly from external systems
  • NAT - VM gets a private IP address (vmnet8 by default), can reach external systems, can be accessed from the host only (or via port mapping)
  • Host-Only - VM gets a private IP address (vmnet1 by default), can only reach the host, can be accessed from the host

From what you describe, I assume you have "Bridged" networking configured. To achieve what you want, switch to one of the other two options (depending on your needs). This will allow you to access the host's SFTP server through it's VMware virtual network adapter's IP address. If you are going to connect to the SFTP serverusing it's FQDN, make sure that it resolves to the private IP address.

André

Shakmatt
Contributor
Contributor

thank you for that answer. It helps me out. Currently, the VM settings states it is using NAT.

One problem i have ran into. I removed my physical router from the HOST machine, its a dumb terminal now, and now i am trying to connect to it from the VM, but obviously, under win10 ipconfig, it says media disconnected for my physical nic. i even assign my physical nic a static ip, but i still get media disconnected.

is there a host only virtual nice i need to configure?

you know what, let me better explain what my goal is, i want my VM to connect to the sftp server on my host machine via the fastest way possible and still have internet. the reason i dont want it to use the physical LAN, i am using my friends router whcih is the appartment below me and threw another wall so it can be slow, even over the lan..... Internet is fast enough to get about 1MB downloads via wifi

my goals:

Cnnect VM to the internet via through the hosts internet, slow but still decent to watch netflix..

Connect to the hosts sftp server in the fastest way possible, avoiding the physical Lan if plausable

once again thank you:)

Also, where is the vmnet config settings now? i used to be able to edit vmnet 1,8 etc to have what ever ip, subnet etc i wanted using a network adapter settings utility that came with vmware

0 Kudos
a_p_
Leadership
Leadership

Also, where is the vmnet config settings now?

If you do have VMware Workstation Pro, then you should also have access to the "Virtual Network Editor".

Anyway, run "ipconfig /all" on the host to determine it's NAT virtual address (vmnet8), which should the a dot 1 address (e.g. 192.168.xxx.1). This is the address you may use from the VM to access the SFTP server on the host (you may need to check the host's firewall, as well as the SFTP server allow the connection).


André

Shakmatt
Contributor
Contributor

hmm, i have the free edition i think. i do not have a file, edit, or tools menu at all.

Is there a way to get it to work with the free edition? i know back on other version you could get it to work.. its for another project, but i will worry about that later.

OHHH, the host is vmnet8 for its nat. ok, that makes sense. yes, now i see why i need the virtual network editor. i want to change the vmnet8 address to be a static one, it seems that this adapter is not consistant with its choosing. Plus i like to keep things organized. i am a ccnp and i like my address spaces to be in a orderly fashion. I need to change it from 192.168.174.1 to 192.168.2.1. that is easier to work with and then i know what networks are what.

thanks

0 Kudos
a_p_
Leadership
Leadership

Not sure whether this will work, but it may be worth a try (maybe someone else knows an easier way to do it).

  1. close VMware Workstation
  2. stop the VMware services (NAT, and DHCP)
  3. change the subnet vmnetnat.conf, and vmnetdhcp.conf in C:\ProgramData\VMware
  4. change the subnet in the registry at "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\VMnetDHCP\Parameters\VirtualEthernetSegments\8"
    HostIpAddress 0x1aea8c0 to 0x102a8c0 (IP address from right to left in hex)
  5. start the VMware services

André

0 Kudos
Shakmatt
Contributor
Contributor

ok, i will try that trick out after i get this sftp server thing working.

Here is my issue. I was able to find my vmnet8 ip address of 192.168.73.2 on my test laptop. i disconnect the physical switch so i hae no internet and LAN on host. I load up the linux test machine and i can ping my win10 vmnet8 NIC. this is good:).

I then turn on bitvise ssh server on my win 10 host machine. Which i have been able to connect to many times. Ok, i then go to the linux machine and type in the file manager address bar

sftp://192.168.73.2:8022

it then produces an error of "refused by the server"

i look at server logs, nothing ever hit the server.... strange, but if i try sftp://t3stact@physical private ip:8022

i check server settings. the account name and password(testing purposes, i use keys once testing is done) are correct. I have passwords enabled for accunts.

i then try sftp://t3stact@192.168.73.2:8022  same error

Thanks

0 Kudos
mkubecek
Hot Shot
Hot Shot

For bridged mode, there is a checkbox "Replicate physical network connection state" in the settings. If it is checked and you disconnect host's physical NIC, guest's virtual NIC will also behave as disconnected (no link). In any case, if you only want to communicate between guest and host, that's what "host only" mode is for.

0 Kudos
a_p_
Leadership
Leadership

I was able to find my vmnet8 ip address of 192.168.73.2 on my test laptop.

Are you sure? The default virtual host address is a ".1" address. The ".2" address is used as the default gateway.

André

0 Kudos