3

Question - Trying to run protected virtual machine | Page 2 | XDA Forums

 2 years ago
source link: https://forum.xda-developers.com/t/trying-to-run-protected-virtual-machine.4485689/page-2#post-87382935
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Question Trying to run protected virtual machine

rgarcia1000

Member
Aug 30, 2022
What kernel did you download?

rgarcia1000

Member
Aug 30, 2022
Thanks for the pointer! I've built kernels in the past but forgive me for such a stupid question. You're building this on your pc not your phone right? I keep getting this error on Arch.
Code:
Makefile:625: arch/aarm64/Makefile: No such file or directory
However I can build doing "make ARCH=arm64".

The make file can't find your kernel sources

Is looking at /usr/src/linux-headers-xxxx but not found arch/aarch64/Makefile

rgarcia1000

Member
Aug 30, 2022
Hi,

Is this the kernel you used: ubuntu-20.04-server-cloudimg-arm64-root.tar.xz

If so How do I complie this? Its not a source code

headheadhead

Member
Aug 25, 2022
Been asking for this also, I don't know if I am building the Kernel right.

Head if it is not too much trouble can you show use what you did to build the kernel?

I can list the commands I ran.

Code:
git clone https://github.com/torvalds/linux
cd linux
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-
make defconfig
make -j8
I think the keyword is "crosscompile linux kernel"
You will find the Image file under arch/arm64/boot.

headheadhead

Member
Aug 25, 2022
Hi,

Is this the kernel you used: ubuntu-20.04-server-cloudimg-arm64-root.tar.xz

If so How do I complie this? Its not a source code

This is not the kernel, this is the disk image with root filesystem.
I'm sorry that I am not able to provide the commands of making the disk image, since they are provided by my mentor.
Without the consent of my mentor, I can't provide the commands.

I can roughly describe the steps.

First, create an raw disk image with qemu-img.
Next, use mkfs.ext4 to create a filesystem in the image you make with qemu-img.
After you make an ext4 filesystem, mount it and extract ubuntu-20.04-server-cloudimg-arm64-root.tar.xz under the directory that you mount the disk image.
You may have to do a little more work, like:
disable could init: https://gist.github.com/zoilomora/f862f76335f5f53644a1b8e55fe98320 (see the prevent start section)
disable root password login: Under the directory you mount the image, change the first line of etc/passwd to this: ***root::0:0:root:/root:/bin/bash***.
Finally, unmount the directory.

You just make a disk image that can be used with the following command.

Code:
/apex/com.android.virt/bin/crosvm run --protected-vm -p 'root=/dev/vda' --rwdisk ${my_disk_image} ${my_kernel_image}

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK