Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I frequently work in different locations, and need to have a virtualbox version of Ubuntu server running locally.

While I was at home getting it set up, I was able to ssh into the server using the locally allocated IP address. However, now that I'm elsewhere, ifconfig is still showing the old 10.0.x.x ip address, but instead of being in the 10.0.x.x space, my laptop's ip starts with 192.168.x.x

With that in mind, if there a straightforward way to set up the virtual box Ubuntu server in such a way that I can just connect using "ssh servername" regardless of it's ip address?

share|improve this question

closed as off topic by MDMarra, EEAA, freiheit, Magellan, Ward Nov 11 '12 at 6:10

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

    
remove the word "virtual" and see if the answer progresses logically from your question. Also the answer will depend on how you have your VirtualBox NIC set up. –  voretaq7 Nov 10 '12 at 20:42
    
I appreciate your taking time to answer, but don't see how it helps. My use of virtualbox is to allow me to have a development environment on this laptop that is set up in a similar way to my Linode hosted live server. If you're suggesting I set up a static testing machine in a fixed location for this purpose, then that's not helpful. I do not have any such option. –  Don H Nov 10 '12 at 21:41
1  
It looks like my question is very similar to here: superuser.com/questions/357120/… –  Don H Nov 10 '12 at 21:45

1 Answer 1

To clarify my comment, I'm suggesting (heck, I'm saying outright) that there's nothing special about your system just because it's a VM - Configure it exactly as you would any other system.
(Since you're on Server Fault I have to assume you know how to handle that part - if not that's a question for Ask Ubuntu.)

The only difference is that your VM is connected to a "virtual switch" inside virtual box (which is probably one of Bridged, NAT, or Host Only networking). You should (must) read the Virtual Box documentation on the type of network connections available, and decide which best meets your needs.

My inclination is that you probably want a NAT adapter (so the VM can see the outside world, but you can only SSH to it from your laptop), with the IP address of your Ubuntu VM configured statically (as in the question you linked to), and possibly an entry in /etc/hosts on your laptop so you don't have to type the IP every time.

share|improve this answer
    
Thanks for clarifying, I've currently got a combination of Bridged in the first adaptor and Host Only in the second, which I set up to use a fixed IP in the hopes it wouldn't change when I go to different networks. I'll look into NAT instead of Bridged and see if it's better for this purpose. –  Don H Nov 11 '12 at 0:11

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