Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: ssh scp - host to sever in virtualbox

  1. #1
    Join Date
    Apr 2009
    Location
    Terra incognita
    Beans
    43
    Distro
    Ubuntu 8.10 Intrepid Ibex

    ssh scp - host to sever in virtualbox

    Hello,

    I'm struggling to copy a directory over from my ubuntu host to a ubuntu server in virtualbox.

    following command dosen't work, connection refused.


    sudo scp -r /media/disk/wordpress user@localhost:22:/var/www


    nmap on ubuntu-server gives a warning - Hostname localhost resolves to 2 IPs. Using 127.0.0.1.


    not sure where i'm going wrong here. any help would be much appreciated.

  2. #2
    Join Date
    May 2007
    Location
    /earth/US/Illinois
    Beans
    1,705
    Distro
    Ubuntu

    Re: ssh scp - host to sever in virtualbox

    check in your guest OS what your IP is first. localhost from your host os will point to that os, not your virtual machine.
    Dialup or no internet on your Ubuntu box? Have no fear, Keryx is here! Keryx Project
    My blog

  3. #3
    Join Date
    Apr 2009
    Location
    Terra incognita
    Beans
    43
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: ssh scp - host to sever in virtualbox

    not sure how to check what the guest os ip is?


    I can connect via ssh to the guest using $ ssh -l <user> -p 2222 localhost

  4. #4
    Join Date
    Jul 2008
    Location
    Netherlands
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: ssh scp - host to sever in virtualbox

    Quote Originally Posted by pantone186 View Post
    sudo scp -r /media/disk/wordpress user@localhost:22:/var/www
    Are you using NAT for the guest VM or "bridged" with the host interface ?
    With NAT the guest will have a 10.0.2.x ip address from within VB.
    When bridge is in use it will get an ip address by DHCP from your LAN.
    Please check the ip address inside the guest VM.

  5. #5
    Join Date
    Apr 2009
    Location
    Terra incognita
    Beans
    43
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: ssh scp - host to sever in virtualbox

    it's using nat with port forwarding.

    I thought the 10.0.2.2 was for accessing host from within the guest?


    How do I check the ip inside the guest vm?

  6. #6
    Join Date
    Jul 2008
    Location
    Netherlands
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: ssh scp - host to sever in virtualbox

    Quote Originally Posted by pantone186 View Post
    it's using nat with port forwarding.

    I thought the 10.0.2.2 was for accessing host from within the guest?

    How do I check the ip inside the guest vm?
    Yes, 10.0.2.2 is the host ip address within NAT on VirtualBox (and also on Qemu).
    Try "ifconfig" inside your guest VM.

  7. #7
    Join Date
    Apr 2009
    Location
    Terra incognita
    Beans
    43
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: ssh scp - host to sever in virtualbox

    ifconfig gives

    eth0 10.0.2.15

    and

    local loopback 127.0.0.1

  8. #8
    Join Date
    Jul 2008
    Location
    Netherlands
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: ssh scp - host to sever in virtualbox

    Quote Originally Posted by pantone186 View Post
    eth0 10.0.2.15
    Okay, does it work with that ?

  9. #9
    Join Date
    Apr 2009
    Location
    Terra incognita
    Beans
    43
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: ssh scp - host to sever in virtualbox

    no, unfortunately, the terminal just seems to hang

  10. #10
    Join Date
    Jul 2008
    Location
    Netherlands
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: ssh scp - host to sever in virtualbox

    Quote Originally Posted by pantone186 View Post
    no, unfortunately, the terminal just seems to hang
    In the past I had much better luck with "bridged" vs. NAT in VirtualBox.
    NAT would work fine for the guest, but from the host to the guest I had problems afair.
    So, if no one else can offer you a better solution, and if it's OK for you, use "bridged" to host interface in VB instead, giving the guest VM its own ip address.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •