How to change the host file

285 views
Skip to first unread message

nao e o meu nome

unread,
May 2, 2022, 4:17:03 PM5/2/22
to Android-x86
Hello,
I installed android 9.0.r2. from your iso file using the not automatic installation. The purpose was to choose "No" in the question: make system read only.
I start the virtualbox and enter Android.

In my host compuer i type:
adb connect x.x.x.x:5555 //connects successfully
adb root
adb shell
id //returns my id as root
vi /etc/hosts //it always opens as read-only.

How can i change the hosts file?
Thank you




İlhan Atahan

unread,
May 3, 2022, 6:03:56 AM5/3/22
to Android-x86
mount -o rw,remount /system

For A10 and up it is
mount -o rw,remount /
2 Mayıs 2022 Pazartesi tarihinde saat 23:17:03 UTC+3 itibarıyla nao.e.o.me...@gmail.com şunları yazdı:

nao e o meu nome

unread,
May 3, 2022, 8:08:13 AM5/3/22
to andro...@googlegroups.com
Hello,
Thank you for your help. But it did not work OR i am still doing
something wrong. These are my steps:

adb connect x.x.x.x:5555 //connects successfully
adb root
adb shell
id //returns my id as root
mount -o rw,remount /
vi /etc/hosts //still opens as read-only.
mount -o rw,remount /system //tried this
'/dev/loop1' is read-only //returns this error.

Can you give my more help to solve this? Thank you.

İlhan Atahan <ata.ilhan...@gmail.com> escreveu no dia terça,
3/05/2022 à(s) 11:04:
> --
> You received this message because you are subscribed to a topic in the Google Groups "Android-x86" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-x86/2VawH0CPxyc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to android-x86...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/android-x86/7f34b11a-f7d0-460d-a50b-da0f4a5cfa74n%40googlegroups.com.

nao e o meu nome

unread,
May 3, 2022, 8:08:59 AM5/3/22
to Android-x86
Hello,
Thank you for your help. But it did not work OR i am still doing
something wrong. These are my steps:

adb connect x.x.x.x:5555 //connects successfully
adb root
adb shell
id //returns my id as root
mount -o rw,remount /
vi /etc/hosts //still opens as read-only.
mount -o rw,remount /system //tried this
'/dev/loop1' is read-only //returns this error.

Can you give my more help to solve this? Thank you.
(sorry i sent a direct email to you by mistake!).

Michael Goffioul

unread,
May 3, 2022, 8:12:25 AM5/3/22
to Android-x86
If you didn't install Android-x86 in read-write mode, you cannot edit anything on the system partition.


You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-x86/CANyuWVWcRNH5WczqYcVw0JV8CH6F01aZ3mXLyvURMhVnLjvUYQ%40mail.gmail.com.

nao e o meu nome

unread,
May 3, 2022, 2:31:09 PM5/3/22
to Android-x86
You are right! I made a mistake during installation in the question: Make it read/write. I reinstall it choosing Yes (meaning make it read/write).
Now when i run the command vi/etc/hosts does not appear the ReadOnly alert but i cannot change the file either. Before i could change it but not save it. Now i cannot edit at all (the vi opens the file but i cannot do nothing).
Can you give a clue on what i am still doing wrong? Thank you.

nao e o meu nome

unread,
May 3, 2022, 3:23:19 PM5/3/22
to Android-x86
One update:
adb pull /etc/hosts /tmp
then edit in host computer and
adb push /tmp/hosts /etc/hosts

It works! But the Chrome and Firefox browser seems to not be apple to open the webpage defined in hosts. I restarted the VM and the changes to the hosts files are still there.

These are the IPs:
Android VM is with IP 192.168.179.19 and gateway 192.169.179.1 (my router)
The host machine has the IP 192.168.179.11 and it has the apache httpd (it works well even in other VM) .

Why the android does not "see" the httpd in the host machine. It appears a security problem in Android. Any clues? Thank you for all support so far.

nao e o meu nome

unread,
May 9, 2022, 8:45:32 AM5/9/22
to Android-x86
Today, it simply works. I don't know what happened on Android. Thank you all.
Reply all
Reply to author
Forward
0 new messages