0

I was trying to set up a virtual linux server (ubuntu) on a windows host using VMWare Workstation 12 Player. The point is to be able to access the server from my browser on windows. The tutorial I am using managed to connect to the guest at localhost (which I have been told is not possible) without much explanation.

I eventually figured it out by connecting via the network adapter ip rather than localhost. See my answer below.

**There are questions similar to this (with better solutions) but solutions for workstation 8 and below don't seem to apply.

1 Answer 1

0

Instead I ran a simple server called "http-server" (https://www.npmjs.com/package/http-server) and used

http-server /path/to/index -a 192.xxx.xx.xx -p 3000

Somehow my instructor managed to do it at localhost but never mind that now. If you are stuck here as I was go to VMware network settings and select custom VMnet1 as a network adapter. Then run ipconfig on the host and get the VMnet1 ip address and connect to it in your browser at 192.xxx.xx.xx:3000 and it should work.

Hopefully this helps but if anyone knows how on the great green earth to get this at localhost please let me know.

EDIT ONE:

Using VMnet1 (host only) settings will not give the server access to the internet but doing the same thing with VMnet8 (NAT) will work better.

EDIT TWO:

See Express as well for essentially the same method but with javascript. https://www.npmjs.com/package/express

  1. create index.js file with

var express = require('express') var app = express() app.get('/', function (req, res) { res.send('Hello World') }) app.listen(3000)

  1. Run nodejs index.js on the server OR the way it is called in the Express documentation

    1. go to servers ip address at port 3000 in host browser.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .