PDA

View Full Version : Edit OUYA hosts File, Add Local Machines to it



Eldon.McGuinness
11-12-2013, 02:29 AM
When it comes to Windows shares and other network services that can use netbios names (aka machine names), the best way to ensure that the name resolution is completed is to add the entries in the machines hosts file, the OUYA is no exception.

Preamble:
This does entail making some sensitive changes to your OUYA and as such if done incorrectly it can brick your device. I documented the steps I took to get the desired effect, but this is in no way a guarantee that you will not brick your device and I do not take responsibility for any losses if you do so.

Requirements:
This does require you to have the adb bridge setup between your computer and OUYA.

1) Connect to your ouya, this can be done with a mini-usb cable or over a network connection after you install the adb software and drivers. This really is beyond the scope of this doc, please check the OUYA development docs for information on how to set it up.

2) Open a terminal to the OUYA

adb shell

2) Re-Mount the Filesystem as Read/Write

su
mount -o rw,remount /system
chmod 666 /etc/hosts

3) Pull the current hosts file

adb pull /etc/hosts

4) Open the hosts file with a decent editor, such as notepad++, and add your entries into the list:
(Example hosts file)

127.0.0.1 localhost
10.0.1.11 PC-0
10.0.1.12 PC-2
10.0.1.13 LAPTOP-0

10.0.1.20 XBOX-0
10.0.1.21 WII-0
10.0.1.22 OUYA-0

10.0.1.40 IPPHONE-0
10.0.1.41 IPPHONE-1

10.0.1.50 KINDLE-0

10.0.1.254 PRINTER-0

5) Save and push the changed file back to the OUYA

adb push hosts /etc/hosts

6) VERY IMPORTANT Re-Mount the filesystem as Read-Only. THIS MUST BE DONE OR YOU COULD BRICK YOUR OUYA

chmod 644 /etc/hosts
mount -o ro,remount /system

7) Disconnect from the OUYA and reboot it, now you do not have to use those annoying IP addresses again when adding shares to apps such as XBMC as you can rest assured name resolution will work.

mmartino
11-12-2013, 01:40 PM
Eldon, is there a reason we have to do this? I installed XBMC and it sees my network and computers by name. Is there some kind of additional function using host files?

Eldon.McGuinness
11-12-2013, 05:08 PM
This by no means required for anything, but many people experience issues when trying to use machine names in application/systems/networks that may not play well with netbios name resolution. This is can be done to alleviate said issue. You can always use IP, but I find using a machine name is much more preferable as it is easier to figure out what device it is when you have explicit names.

s7eele
10-06-2014, 04:07 AM
Alright, moved over here, see if I can get some activity going. To continue the discussion about the hosts file, I've already rooted installing both superuser and busybox. My question about editing the host file is:

1). The directions using adb to pull and push the file seems outdated and unnecessary but I figure I better ask, especially about the chmod and mnt commands. With the current status of my Ouya (rooted, superuser, busybox) shouldn't I be able to edit it locally using something like ES File Manager or possibly after installing a terminal emulation program to edit it via command line (vi?).

Not looking for anyone to do the research for me but if a quick pointer in the right direction could save me some time....

Sent from my HTC6525LVW using Tapatalk

Eldon.McGuinness
10-06-2014, 05:37 AM
You definitely could try to edit them locally, thought I can not say how effective it will be. I've always done it over adb :D

s7eele
10-14-2014, 09:40 PM
You definitely could try to edit them locally, thought I can not say how effective it will be. I've always done it over adb :D
Wow, I just posted an update in the other thread, forgot abouth this one already. I'll give a quick update here in this thread. Turns out my SMB issue was caused by something on my end, completely unrelated to the Ouya. I believe it was either an issue with an old router or having to manually disable the Vista firewall service, just turning off the firewall doesn't seem to be enough. Anyway, SMB is now working without an issue, no changes on Ouya required.

Sent from my HTC6525LVW using Tapatalk