Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to write a script that can add new hosts to /etc/hosts from within a virtual machine as I use VMs for web development and need to set up virtualhosts that are accessible from the host machine.

Obviously I can do this manually, but where's the fun in that?

I was wondering if there's a way to communicate with the host machine other than via the network - my guess is no but maybe there is something?

share|improve this question

No, you cannot do this. You need a network connection to be able to talk to the virtual machine/host. You can make a script that populates your host machine hosts file with the VM's hostname though.

I have no idea why I added this as a comment oops.

share|improve this answer
Lol, me neither ;) – John Hunt Nov 15 '12 at 14:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.