Announcement

Collapse
No announcement yet.

Different IP for VirtualBox machine??

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Different IP for VirtualBox machine??

    The title kinda says it all. I am wondering if there is any way to have my router assign a different IP address to a VM? In essence, I want to have two different IPs assigned to the same computer, one for the "host" machine and one for the virtual machine. Basically, I want to set up an Ubuntu server in a VM to do some testing. I could certainly set up a server on an extra computer but I anticipate many re-installs while I experiment with things, and for that a VM would be easier to manage.

    I have Googled and read up a lot on different sites. Many people have the same question as I, but I wasn't able to find any real answers for how to do it, let alone if it is even possible. I am asking here first because I already am a member, but if all else fails I can grab an account at forums.virtualbox though I would prefer not to.

    As always, thanks in advance for any information or tips you fine folks can offer.

    EDIT: I accidentally posted this in the 14.10 forum. I am actually running 14.04 LTS. Sorry for the mistake

    #2
    Maybe VMWare - Virtual operating system static IP address will be of help.
    Last edited by Snowhog; Dec 07, 2014, 02:21 PM.
    Windows no longer obstructs my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      Originally posted by Snowhog View Post
      Not sure what's up, but absolutely nothing happens when I click that link o.O

      Comment


        #4
        Oops! Fixed my hyperlink in my post.
        Windows no longer obstructs my view.
        Using Kubuntu Linux since March 23, 2007.
        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

        Comment


          #5
          Originally posted by Snowhog View Post
          Oops! Fixed my hyperlink in my post.
          Thanks, I'm checking it out now. It's mainly focused on Windows/VMWare but I imagine the methods are similar for VirtualBox.

          Comment


            #6
            So... if I'm understanding this correctly, one way to accomplish this is to first determine the MAC address of the virtual machine and then have my router assign an IP address to that MAC. That sounds simple enough to do. And then when this is done, my router will see two different IPs and pass along the correct traffic to the VM's IP.

            Am I correct?

            Comment


              #7
              As I understood the information on the site I posted, yes.
              Windows no longer obstructs my view.
              Using Kubuntu Linux since March 23, 2007.
              "It is a capital mistake to theorize before one has data." - Sherlock Holmes

              Comment


                #8
                Originally posted by Snowhog View Post
                As I understood the information on the site I posted, yes.
                Awesome & thank you for the fast replies Going to play around with it some this evening and see what I can come up with.

                EDIT: I was going to +1 you but I didn't realize there was no Rep Point system here. So consider yourself +1'ed :P LOL
                Last edited by GKNByNW; Dec 07, 2014, 02:56 PM.

                Comment


                  #9
                  Happy to assist, and hopefully, the information I linked will get you what you want.

                  Our forum doesn't use a Kudos/Like reputation system, as they nearly always get abused. That we are able to help a member, and they say so, is +1 enough for us.
                  Windows no longer obstructs my view.
                  Using Kubuntu Linux since March 23, 2007.
                  "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                  Comment


                    #10
                    Originally posted by Snowhog View Post
                    Happy to assist, and hopefully, the information I linked will get you what you want.
                    I had a couple spare minutes to play around with it and got it figured out within about 2 minutes

                    So, for anyone else who may come across this topic: Even though I have DHCP on for my home network, my router (Linksys E1200) makes it easy enough to assign a static IP to a specific MAC address through the DHCP Reservation button. Unless you have the most basic El Cheapo router, you should have a similar feature. Depending on how complicated your router's setup page(s) are, you may have to hunt around for it or check with Google. To get the MAC address of your Ubuntu server VM simply run the 'ifconfig' command, note the HWaddr info, plug this MAC into your router's DHCP reservation, and assign it whatever static IP you wish within your router's DHCP IP address range.

                    Initially it didn't work for me, but I quickly remembered I had the wrong network settings for my VM. When I created the VM it set the network adapter as "Attached to NAT" by default. So in order for this to work, you need to switch the VM's network adapter to "Attached to Bridged Adapter" and reboot the VM. (NOTE: This info applies to VirtualBox. I cannot speak for VMWare, though I reckon it's similar.) To double-check, you may want to check your router's status page to verify that the VM now shows up with the correct IP and MAC addresses.

                    You can now use the command terminal on your host machine to ssh into the Ubuntu server VM and treat it as if it were a remote server.

                    NOTE: If you are planning on using the VM server to serve up webpages inside your home network, you should be fine. However, if you will be remotely accesing the server from outside your home you will have to set up the appropriate port forwarding on your router.

                    Originally posted by Snowhog View Post
                    Our forum doesn't use a Kudos/Like reputation system, as they nearly always get abused. That we are able to help a member, and they say so, is +1 enough for us.

                    Comment


                      #11
                      Yep. That's how I set mine up. I used bridged networking on my VirtualBox guest. My Netgear router sees the attached devices and displays the MAC address. I choose to reserve the IP address for that MAC address. This VirtualBox guest is a headless file server that shares a read only copy of our family photos. Everyone can enjoy them without the risk of having them altered or deleted.
                      sigpic

                      Comment


                        #12
                        Originally posted by life0riley View Post
                        Yep. That's how I set mine up. I used bridged networking on my VirtualBox guest. My Netgear router sees the attached devices and displays the MAC address. I choose to reserve the IP address for that MAC address. This VirtualBox guest is a headless file server that shares a read only copy of our family photos. Everyone can enjoy them without the risk of having them altered or deleted.
                        I don't have any set plans in mind at this point beyond teaching myself server setup/administration. Like I said a few posts back, a VM offers me the flexibility to do quick reinstalls when I botch something up - and I know I will! It's a simple matter of installing the OS and making a clone or two.

                        One thing I discovered is that, at least in my case, I had to leave the VM network set to NAT until after the install was completed. Otherwise, it wouldn't connect to the internet for the time server, updates, etc., during installation.

                        Comment

                        Working...
                        X