Search code examples
ubuntusshwebos

ssh_exchange_identification: read: Connection reset by peer: WebOSE on virtual box


I am trying to connect to webOS installed in virtual box in my ubuntu system. but while entering code:

ssh -p 6622 root@localhost

i get error

ssh_exchange_identification: read: Connection reset by peer.

Please help


Solution

  • HEADS - UP: These set of commands in the Ubuntu 16.04 Linux Distro worked fine for my system, and the "connection reset by peer" error can vary depending on the system, but this solution pertains directly to the WebOS VM in my Ubuntu System.

    The issue of getting the "connection reset by peer" error especially for the WebOs Application running on a Ubuntu VirtualBox is due to the VM not allowing access to the port you specified and can also be due to the manual setup error during installation of VM, so kindly recheck your VirtualBox versions with the Ubuntu Compatible Version of the Extension Pack, before you proceed below:

    I had the same issue and tried out these commands one by one on the Ubuntu CLI, so make sure that you recheck your versions of installation and try these out again:

    sudo ufw allow ssh
    

    Then specified the port that needs to be opened (I did for both port 22 and 6622):

    sudo ufw allow 6622
    sudo ufw allow 22
    

    Restart your ssh service:

    sudo service ssh restart
    

    Most of the times, the error also occurs even after these steps as the virtualbox setup of the WebOS Emulator can inherently be faulty due to the manual setup, so try to setup a different machine in the same VM via the Ubuntu Shell with these commands (these commands are also specified in https://www.webosose.org/docs/tools/sdk/emulator/virtualbox-emulator/emulator-user-guide/#setting-up-the-virtual-machine-in-virtualbox):

    Firstly, close all other instances of the WebOS Windows and VM Machine running in the background and then continue with the following in the Ubuntu Shell

    Note: (this again creates a new different machine for the emulator, but using the CLI) -->

    Creating a new Linux Based Sub - Machine System of Name "webos-image":

    vboxmanage createvm --ostype Linux --register --name webos-image
    

    Assigning Parameter Values instead of the manual settings variable changes:

    vboxmanage modifyvm webos-image --memory 2048 --vram 128 --ioapic on --cpus 2
    vboxmanage modifyvm webos-image --graphicscontroller vmsvga
    vboxmanage modifyvm webos-image --accelerate3d on
    vboxmanage modifyvm webos-image --audio pulse --audioout on --audioin on
    

    SSH and Web-Inspector Assignment:

    vboxmanage modifyvm webos-image --nic1 nat --nictype1 82540EM --natpf1 ssh,tcp,,6622,,22
    vboxmanage modifyvm webos-image --natpf1 web-inspector,tcp,,9998,,9998
    vboxmanage modifyvm webos-image --mouse usbtablet
    vboxmanage modifyvm webos-image --uart1 0x3f8 4 --uartmode1 file /dev/null
    vboxmanage storagectl webos-image --add ide --name webos-image
    

    Only when you want to set 2 monitors, default is 1

    vboxmanage modifyvm webos-image --monitorcount 2
    

    In order to attach the .vmdk to the VM (use the proper path convention for your WebOS Image, specifying the correct location where the image has been stored in your system):

    THAT IS: Replace </path/to/image/webos-image-qemux86-master-**.wic.vmdk> with your directory path to the WebOS Image (and dont include the tags!!)

    vboxmanage storageattach webos-image --storagectl webos-image --type hdd --port 0 --device 0 --medium </path/to/image/webos-image-qemux86-master-**.wic.vmdk>
    

    Launch the WebOS VM again from the CLI:

    vboxmanage startvm webos-image
    

    You will see the VM starting with an underlying WebOS Kernel Boot

    Now run:

    ssh -p 6622 root@localhost
    

    If you reach till this stage, a prompt about the localhost:6622 being permanently added as a host will show up, type "yes" and then you will be directed to a root-qemux terminal