Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to start playing around with Ubuntu Server on my machine (Macbook Pro) running off VirtualBox or something similar.

I want to do this so I can get used to using Ubuntu Server, and so I can have an environment where I can try getting things setup the way I want without having to worry about messing around with a separate machine yet.

Is it possible that I can connect to the server that is virtualised on my machine through a browser in the main Mac OS X installation?

If so, how can this be configured, or does it run like localhost by default?

Any advice would be appreciated.

share|improve this question

3 Answers 3

up vote 1 down vote accepted

No and Yes.

First, let's talk about the No.


No.

The virtual server will be just like it was its own server so will be accessed in a separate window with it's own desktop / shell interface. I'm sure your familiar with that concept:

enter image description here

In the image above, Windows 7 is running in a virtual instance. That will be your main interface to the server for anything that you choose to do to it.


Yes.

Since the server is as good as if it was its own unit running outside of OS X, you can access it with a browser if there is a web server that is accepting connections on the Ubuntu server.

You could install a control panel on the Ubuntu server that allows you to configure and modify the server such as Webmin or GNU Panel. I wrote a blog post recently that lists dozens of possible control panels for different operating systems. I promise I am not shilling for my own blog, but I've never seen anyone try and list them all out like this. Take a look at it here: List of Web-Based Server Control Panels.

You will need to allow traffic through your virtual NIC and switch as well as through the firewall on the virtualized Ubuntu. Treat it just like you were setting up a physical Ubuntu server under your desk. The practices remain the same, physical or virtual. Once all of that is done, you can access the server through a web browser on OS X.


Summary:

  1. Install Ubuntu as a VM.
  2. Install a LAMP stack or a web based control panel and set it up to accept connections as per a normal web server.
  3. Allow traffic through the virtual network infrastructure.
  4. Point your OS X web browser at the virtual machine's IP address / domain name
  5. Enjoy!
share|improve this answer

While this isn't the smartest way to do it, there are ways to.

VMware server works like this by default - it runs headless, and you manage VMs over a web browser session. It hasn't been updated as of late, so virtualbox is a good choice

Assuming you want a CLI interface over a web browser you can install ajaxterm or webshell for web based ssh access (but what you really should do is to use a proper ssh client on OS X)

You could also get a java based vnc client which you can run on your browser for gui, but a smarter option would be to use your VM software... the way most people do. Virtualbox also has an RDP option, which is nice sometimes. On the other hand, you don't want gui on a server.

As for configuration, if you don't want the system accessed from the outside world, go host only. If you are on a wireless connection, you must use the nat option. Bridged is the best if you want it usable elsehwere, and unless you need the other two conditions met, go for it.

Set up, and install your linux system, check the ip address (with ipconfig) and connect using that not localhost

In short, you can. Practically, you don't want to

share|improve this answer
    
I basically meant install a LAMP stack on the server and then access that server (as if I was someone from outside) from the mac side - not a terminal interface or anything. - Would it be possible to just assign my ubuntu server to be running on a localhost port? –  Alex Coplan Dec 29 '11 at 6:30
    
oh, that. Your question was NOT very clear. No, the VM would have its own ip address, and you should use that. –  Journeyman Geek Dec 29 '11 at 6:34
    
Thanks, sorry it wasn't very clear I didn't know how else to say that... –  Alex Coplan Dec 29 '11 at 6:39

Yes - you can access the server desktop using vnc if you want. Another option is running the the vm as a headless instance. This means you could ssh into it but not have it running in a window. In some casese like if you were running your instance on a headless sever this is quite handy. You can still access the headless instance via VNC too.

VBoxHeadless -startvm "nameofguest"
share|improve this answer

Your Answer

 
discard

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.