So verwenden Sie VMware Workstation 12 Player als virtuellen Host

468
LQWill

Ich habe versucht, einen virtuellen Linux-Server (Ubuntu) auf einem Windows-Host mit VMWare Workstation 12 Player einzurichten. Es geht darum, von meinem Browser unter Windows auf den Server zugreifen zu können. Das Tutorial, das ich verwende, hat es geschafft, eine Verbindung mit dem Gast bei localhost herzustellen (was mir gesagt wurde, dass dies nicht möglich ist), ohne viel Erklärung.

Ich fand es schließlich heraus, indem ich mich über den Netzwerkadapter ip und nicht über localhost verband. Siehe meine Antwort unten.

** Es gibt ähnliche Fragen (mit besseren Lösungen), aber Lösungen für Workstation 8 und darunter scheinen nicht zutreffend zu sein.

0

1 Antwort auf die Frage

0
LQWill

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.