Android-x86 boot over network using NFS and iPXE

325 views
Skip to first unread message

Hassin Ayaz

unread,
Jul 16, 2018, 2:14:14 PM7/16/18
to Android-x86
Dear All , 

This is my first post & i need help 

I want to boot android-x86 over network . Following is my plan 

1.  i will build new android-x86 images 
2.  The build output folder will be served by my host machine [server] over NFS 
3.  My Client computer will first boot from iPXE USB 
4.  Client Computer will get dhcp from from my home Router
5.  in the iPXE rom there is my server PC ip address and  the NFS path 
6.  Client computer will fetch kernel & initrd.img from the NFS server , it will finish the first stage booting 
7.  Client computer will then go the 2nd stage boot where ramdisk.img will be mounted , the init script will be called to prepare everything afterwards 
8.  Android-x86 will finally Boot 

For my plan to work i have compiled the kernel, adding as much as supports as i can guess . I have added the following supports at kernel menuconfig 

CONFIG_IP_PNP=y          
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
CONFIG_IP_PNP_RARP=y
CONFIG_USB_USBNET=y
CONFIG_USB_NET_SMSC95XX=y
CONFIG_USB=y
CONFIG_USB_SUPPORT=y
CONFIG_USB_ARCH_HAS_EHCI=y
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_ROOT_NFS=y
CONFIG_DNS_RESOLVER=y
CONFIG_VIRTIO_NET=y
CONFIG_E1000=y
CONFIG_NFS_V2=y
CONFIG_NFS_V4_1=y
CONFIG_NFS_V4_2=y
CONFIG_PNFS_FILE_LAYOUT=y
CONFIG_PNFS_BLOCK=y
CONFIG_NFS_V4_SECURITY_LABEL=y
CONFIG_NFS_USE_KERNEL_DNS=y
CONFIG_GRACE_PERIOD=y
CONFIG_LOCKD=y
CONFIG_SUNRPC=y
CONFIG_SUNRPC_GSS=y
CONFIG_SUNRPC_BACKCHANNEL=y
CONFIG_KEYS=y
CONFIG_ASSOCIATIVE_ARRAY=y
CONFIG_OID_REGISTRY=y

the kernel got compiled and the iso image was also generated . I have tested the image at virtualbox using live CD option & it runs 

But when i want it to boot over network it fails with the following errors
-------------------------------------------------------------------------------------------
> init cannot find '/system/bin/keystore' disabling keystore 
> init cannot find '/system/bin/app_process64' disabling zygote 
..........................
..........................
> cannot find /sys/class/android_usb/ 
..........................
binder 1756:1756 transaction failed 29189, size 0-0 
-------------------------------------------------------------------------------------------
attached images has the full error log 

my iPXE script was

------------------------------------------------------------------------------------------ 
#!ipxe

echo Hi, i am trying to boot androidx86
dhcp
set server_ip 192.168.0.106
set nfs_path /home/ayx/android-x86/out/target/product/x86_64
kernel nfs://${server_ip}${nfs_path}/kernel || read void
initrd nfs://${server_ip}${nfs_path}/initrd.img || read void
initrd nfs://${server_ip}${nfs_path}/ramdisk.img || read void
imgargs kernel androidboot.hardware=android_x86_64 root=/dev/nfs rw nfsroot=${server_ip}:${nfs_path},nolock,wsize=4096,rsize=4096 ip=dhcp initrd=initrd.img,ramdisk.img ROOT=${server_ip}:${nfs_path}
boot
echo Booting
-------------------------------------------------------------------------------------------

Now i cannot understand what i am missing , have i missed anything in the iPXE script or at the Android-x86 side ? 

eagerly waiting for your help 
Thanks a lot 







4.jpg
5.jpg

Chih-Wei Huang

unread,
Jul 18, 2018, 11:04:06 PM7/18/18
to Android-x86
It seems /system is not mounted.

> ..........................
> ..........................
>> cannot find /sys/class/android_usb/
> ..........................
> binder 1756:1756 transaction failed 29189, size 0-0
> -------------------------------------------------------------------------------------------
> attached images has the full error log
>
> my iPXE script was
>
> ------------------------------------------------------------------------------------------
> #!ipxe
>
> echo Hi, i am trying to boot androidx86
> dhcp
> set server_ip 192.168.0.106
> set nfs_path /home/ayx/android-x86/out/target/product/x86_64
> kernel nfs://${server_ip}${nfs_path}/kernel || read void
> initrd nfs://${server_ip}${nfs_path}/initrd.img || read void
> initrd nfs://${server_ip}${nfs_path}/ramdisk.img || read void
> imgargs kernel androidboot.hardware=android_x86_64 root=/dev/nfs rw
> nfsroot=${server_ip}:${nfs_path},nolock,wsize=4096,rsize=4096 ip=dhcp
> initrd=initrd.img,ramdisk.img ROOT=${server_ip}:${nfs_path}

Which android-x86 version do you use?

Indeed I just notice a recently change (since Jan)
in init script broke the ROOT=${server_ip}:${nfs_path}
syntax.

I have fixed it in the nougat-x86 and oreo-x86 branches.
Please sync to get the fix.


> boot
> echo Booting
> -------------------------------------------------------------------------------------------


--
Chih-Wei
Android-x86 project
http://www.android-x86.org

Hassin Ayaz

unread,
Jul 19, 2018, 8:38:29 AM7/19/18
to Android-x86
Dear Mr Chih-Wei Huang 

Thanks A lot for your kindest reply & help 

I used the marshmallow version. 
I will try with nougat or oreo version as per your suggestion 

I am coming back with the results .

thanks again

Hassin Ayaz

unread,
Jul 20, 2018, 2:52:58 PM7/20/18
to Android-x86
Dear Mr Chih-Wei Huang

i have tried with nougat but now stuck at the following error
----------------------------------------------------------------------------------------------------------------------
audit: type=1400 audit(1532085853.939:5): avc: denied {create } for pid comm="init" name="cpu.rt_period_us" scontext=u:r:init:s0 tcontext=u:object_r:cgroup:s0 tclass=file permissive=0
...
...
...
random: init: uninitialized urandom read (40 bytes read)
binder: 1696:1696 transaction failed 9189/-2 size 0-0 line 3018 
------------------------------------------------------------------------------------------------------------------------
can you kindly tell what i am missing 
thanks 

IMG_20180721_002415.jpg
Message has been deleted
Message has been deleted
Message has been deleted

Hassin Ayaz

unread,
Jul 28, 2018, 5:01:38 AM7/28/18
to Android-x86
Dear Mr Chih-Wei 

I have have able to boot over nfs with latest nougat branch but now the booting freezes at the following warning message: 

------------------------------------------------------------------------
random: 7 urandom warning(s) missed due to ratelimiting 
------------------------------------------------------------------------

both at VM and actual laptop the same error prompts , attached is the vm output 

would you kindly tell what i am missing 
thanks a Lot
Screenshot from 2018-07-28 14-55-40.png

shahul hameed

unread,
Dec 15, 2018, 4:20:43 AM12/15/18
to Android-x86
Hi

I am also facing same issue. how you solved it. Please let me know.

Thanks and Regards,
Sk shahul.
Reply all
Reply to author
Forward
0 new messages