Announcement

Collapse
No announcement yet.

A Modest Proposal to Change the Network Settings on LocalAppInventor Appliance

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

  • A Modest Proposal to Change the Network Settings on LocalAppInventor Appliance

    Tom:

    As I understand it, the rationale for choosing the Host_only networking option to communicate between the virtual machine (Ubuntu + LocalAppInventor) and the host machine was that it allows the application to be accessed via a consistent IP and port (192.168.56.35:8888) on all hosts without affecting the existing networks. A side effect of choosing this option is that the VM is visible only to the host on which it is running, but I don't know if that were a desideratum.

    I think this choice was quite reasonable and fully expected it would "just work", as it has on all the hosts I've installed to, which include 5 Linux Mint 17.1/17.2 systems and 1 each Windows 7 and 8 systems. The difficulties some Windows users are experiencing are perplexing to me, but I no longer know the inner workings of MS Windows well enough to conjecture what's happening to them.

    Here's a modest proposal: Use the "Port Forwarding with NAT Networking" option instead.

    This option mimics the port forwarding feature of network routers, in this case the "router" being VirtualBox. The VM has access to the outside world but is invisible from outside (including from the host) as with the default NAT option, except that once port 8888 is set as a forwarded port, calls to port 8888 on the host machine are forwarded automagically to port 8888 on the VM.

    I have just experimented successfully with this option on both a Linux Mint 17.1 host and on a Windows 8.1 host.

    Experimental Scenario:

    1. Reconfigure the VirtualBox network to have no Host-only networks. This means it will default to supporting NAT networking only.

    2. Before starting the LocalAppInventor VM, use the Settings tab in VirtualBox to make the following changes to the VM's Network Settings:
    a. Keep adapter 1 attached to NAT, but, in the Advanced selections, click on PORT FORWARDING and add a rule with Name: [I choose LocalAppInventor but it's arbitrary], Protocol: TCP, Host IP: <blank>, Host Port: 8888, Guest IP: <blank>, Guest Port: 8888
    b. Disable adapter 2.

    3. Start the VM. It comes up as before, but after initialization, the bottom bar displays "IP Address: missing network adapter App Inventor: OK Build Server: OK"

    4. From a web browser on the host, go to the URL "localhost:8888" (of course the hostname or the host IP works instead of "localhost"). The"MIT App Inventor 2" page opens, I log in, and that's the end of my story.

    Note 1: On the Windows host, the first time I start the VM, Windows Firewall pops up to warn me about access to networks. I choose to access just home and work networks and drove on.

    Note 2: I can also now access the App Inventor from other computers on the same LAN using this "master" host's URL http://<hostname or host IP>:8888. Whether this is desirable is not for me to say. Network settings on the host could be changed if needed to block this "external" access.

    Note 3: I presume the "missing network adapter" message could be fixed up but I don't want to dig through your code. A best practice might be to define a static IP for the VM, but I didn't have time to explore that before composing this message.

    Note 4: the hosts I experimented with already worked fine with the Host_only networking option, so it's possible this proposal could also fail on the affected Windows hosts. I am optimistic that it will work but as Ronald Reagan famously said "Trust but verify!"

    Thanks for all the hard work you and your fellow FTC supporters have put into this software effort. It is *very* impressive.

    Regards,

    Kent

    Mentor to FTC Team 7519 and by extension to its sister Team 7518

  • #2
    PS - I just remembered I haven't yet tested with exchanging files between host and VM. That may require additional jiggery-pokery with the network settings. Sorry for going off half-cocked. So little time, so many things to to ;(

    Comment


    • #3
      Originally posted by TheOldPresbyope View Post
      PS - I just remembered I haven't yet tested with exchanging files between host and VM. That may require additional jiggery-pokery with the network settings. Sorry for going off half-cocked. So little time, so many things to to ;(
      Yes, from my local host browser or a browser on another host on the LAN, I can direct the MIT App Inventor 2 program to "Import a project (.aia) from my computer", "Export selected project (.aia) to my computer", and Build...App (save .apk to my computer)" This works, of course, because the file transfers are proceeding via the http protocol starting on port 8888, just as it does when accessing the program running on MIT servers. [I should have thought of that before I posted my PostScript. I'm slowing down, but my fingers still work faster than my brain does!]

      Now I'm wondering if the ability to access port 8888 on the LocalAppInventor VM from multiple hosts on the LAN might make it possible for programmers to clash trying to modify the same project simultaneously. I haven't explored how the projects are loaded and saved (as opposed to imported and exported). If this possibility of a clash is real, then I believe network settings on the host *must* be set to block access to port 8888 from other hosts on the LAN.

      Regards,

      Kent

      Mentor to FTC Team 7519 and by extension to its sister Team 7518

      Comment


      • #4
        Originally posted by TheOldPresbyope View Post
        Yes, from my local host browser or a browser on another host on the LAN, I can direct the MIT App Inventor 2 program to "Import a project (.aia) from my computer", "Export selected project (.aia) to my computer", and Build...App (save .apk to my computer)" This works, of course, because the file transfers are proceeding via the http protocol starting on port 8888, just as it does when accessing the program running on MIT servers. [I should have thought of that before I posted my PostScript. I'm slowing down, but my fingers still work faster than my brain does!]

        Now I'm wondering if the ability to access port 8888 on the LocalAppInventor VM from multiple hosts on the LAN might make it possible for programmers to clash trying to modify the same project simultaneously. I haven't explored how the projects are loaded and saved (as opposed to imported and exported). If this possibility of a clash is real, then I believe network settings on the host *must* be set to block access to port 8888 from other hosts on the LAN.

        Regards,

        Kent

        Mentor to FTC Team 7519 and by extension to its sister Team 7518

        Much thanks to you Kent!!! I was looking at proxy for the NAT thinking along your lines, and just didn't take the time to connect the dots. I appreciate you doing the heavy lifting. Thank you so much! It does work for us with your solution.

        Comment


        • #5
          Modifying ip50 in /usr/bin in the VM to use eth0 instead eth1 fixes the "missing" message.

          Comment


          • #6
            Originally posted by dmssargent View Post
            Modifying ip50 in /usr/bin in the VM to use eth0 instead eth1 fixes the "missing" message.
            Sweet. I remember now you mentioned this script the other day, but I didn't follow up and actually read it! Your modification works a treat. Thanks!

            At the same time, the valid information returned by the modified script is of no operational value in this networking mode because we aren't routing to this IP, we're only forwarding the host's port 8888 on to the VM's port 8888. (I suppose it is still useful as a diagnostic because it shows the interface is up.)

            Probably won't find time this weekend to come up with an alternative status message. For now, at least, my proposal appears to be a viable workaround for the few teams running into a roadblock with the host-only networking mode.

            Regards,

            Kent

            Mentor to FTC Team 7519 and by extension to its sister Team 7518

            Comment


            • #7
              Thanks for posting this Kent! If it's OK with you, I might add this to the Install Guide to help those who encounter issues running the Host-Only set up.

              Tom

              Comment


              • #8
                Tom,

                Of course it's OK with me. I do hope teams consider it only as a fallback when all else fails. With luck, we'll get enough clues to break through the barrier a few teams are hitting now with their Windows machine and make the host-only networking mode work for all. I've not been able to reproduce their problem playing with the only Windows machine I have at my disposal.

                By the way, every time I look at the documents you put together, I come away more impressed by the amount of work that went into them. Thanks, and a tip of the hat!

                Regards,

                Kent

                Mentor to FTC Team 7519 and by extension to its sister Team 7518

                Comment


                • #9
                  I have found a software named -- All in one App Inventor . It is size only 450 MB. It can builds App Inv Server in Windows without VM. But it is standard AI server.

                  Can someone creat a FTC App Inventor server like that ?

                  URL:http://sourceforge.net/projects/ai2u/

                  Comment


                  • #10
                    This was great! thanks for the idea man. Team 5422 Horse Power thanks you.

                    Comment


                    • #11
                      This works great, but for those of us that don't use Ubuntu regularly, here are the steps:
                      1) Open "Terminal Emulator" from the Whisker Menu in the lower right corner of the LocalAppInventor appliance
                      2) Type: "sudo mousepad /usr/bin/ip50" (everything but the quotes)
                      3) Modity eth0 to eth1, which means
                      this line: declare inet=$(ip -f inet addr show eth0 2> /dev/null | grep inet)
                      changes to this line: declare inet=$(ip -f inet addr show eth1 2> /dev/null | grep inet)
                      4) File: Save
                      Your done! You should now see the actual IP address of your machine in the status bar of the LocalAppInventor appliance.

                      Comment


                      • #12
                        ... Whisker Menu in the lower LEFT corner .... [sorry for that]

                        Comment

                        Working...
                        X