Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can I use this on rooted Galaxy Tab S9 Ultra #24

Open
codrutpopescu opened this issue Feb 10, 2024 · 22 comments
Open

can I use this on rooted Galaxy Tab S9 Ultra #24

codrutpopescu opened this issue Feb 10, 2024 · 22 comments

Comments

@codrutpopescu
Copy link

The CPU is Snapdragon 8 Gen 2 and the Tab S9 Ultra has 16 GB of memory. I am trying to find ways to use this device to run VMs. I would like to use Gunyah but I don't know how to install it.

@jglathe
Copy link

jglathe commented Feb 27, 2024

Try slbounce?

@sunflower2333
Copy link

sunflower2333 commented Feb 29, 2024

Try slbounce?

slbounce won't work on SD8G2 because hypervisor does not support secure-launch feature.
Qualcomm implements this feature in X Elite hyp(also gunyah)
As far as I can see it... codes in this repo are more likely for simulator platform...? Gunyah on qualcomm phones are more likely for secure use case and needs signature to load a vm.

@jglathe
Copy link

jglathe commented Feb 29, 2024

SD8G2 (SC8180XP) boots WoA, though. So... thats what's needed for slbounce. At least worth a try. I have a Volterra running on EL2 this way.

@sunflower2333
Copy link

SD8G2 here is SM8550 Mobile Platform, not SC8180XP or 8cx gen2 Compute Platform...
On sc8180 and sc8280 their hyp is still QHEE based which already has secure-launch feature. (that means you can use slbounce get EL2, or windows can get hyper-v).
On platform Lahaina(SMx3xx, e.g. SM8350, SM7325) and newer, Qcom starts using Gunyah to replace their QHEE. But they did not port secure-launch feature for that(which means you can not use slbounce to get EL2).
They didn't add this feature until the SC8380(also known as the X Elite or x1e80100)'s hyp.
(By the way, not only SM8550's hyp does not support , but SM8650'hyp also does not support this feature.)

On this topic, you can not replace hypervisor on your phone because it need qcom's signature. You can use Qemu to run it on your rooted Galaxy Table S9 Ultra.

@jglathe
Copy link

jglathe commented Mar 1, 2024

Thanks for pointing that out, my bad.

@codrutpopescu
Copy link
Author

codrutpopescu commented Mar 1, 2024

Thanks for clarifying! So the only option currently available for SM8550 is to compile the kernel with KVM support and use QEMU?

@sunflower2333
Copy link

Thanks for pointing that out, my bad.

Sorry i'm not sure with crosvm...
iirc someone tried the linux patch on sm8550 and seems can not get it work properly...

@Famous8
Copy link

Famous8 commented Mar 5, 2024

Unfortunately I cannot help but I would like to second this issue. I am trying to enable either KVM or Gunyah on my Galaxy Tab S8 Ultra to be able to run Windows on Arm virtual machines with hardware acceleration.

@Famous8
Copy link

Famous8 commented Mar 10, 2024

Upon looking at the Galaxy Tab S8 kernel source code, it seems KVM and Gunyah are enabled in the GKI (General Kernel Image), however I am receiving many errors when trying to compile the unchanged source code of the kernel using the provided materials. I will let you know if I am able to flash the GKI successfully and be able to use KVM.

@subashsn
Copy link

I have a Tab s9 and on the stock kernel I tried this in root shell via termux

apex/com.android.virt/bin/crosvm --log-level=debug run "/data/data/com.termux/files/home/vm2/vmlinux"                                                                             <
[2024-03-23T00:49:49.735761079+05:30 INFO  crosvm] crosvm started.
[2024-03-23T00:49:49.736413214+05:30 INFO  crosvm] CLI arguments parsed.
[2024-03-23T00:49:49.736705610+05:30 DEBUG crosvm::crosvm::sys::unix] creating hypervisor: Gunyah { device: Some("/dev/gunyah") }
[2024-03-23T00:49:49.737004256+05:30 ERROR crosvm] exiting with error 1: failed to create vm

Caused by:
    Invalid argument (os error 22)

Still debugging, but so far looks like its having trouble starting the kernel or crosvm is having issues with gunyah. Will update

@Famous8
Copy link

Famous8 commented Mar 22, 2024

I was still never able to get a kernel image working. Each time a boot loop appeared. Perhaps I need to factory reset the operating system before installing a kernel. I think KVM maybe able to work as it is enabled in the GKI

@subashsn
Copy link

subashsn commented Mar 22, 2024

I tried the android13-5.15 GKI and it worked, higher versions didn't boot. But still didn't see a /dev/kvm. So I think we only have gunyah for now, which is fine as they seem to have done everything needed for it to be in AVF and work with crosvm too.

I think the error is actually related to the kernel image I am using to start crosvm, will dig more and keep you posted.

A description of my setup:

  • Voltage 14 GSI (Rooted with Magisk)
  • Latest samsung kernel (android13-5.15)
  • Termux (with root shell)

Update:

  • tried --disable-sandbox - Didn't help
  • tried using all sorts of vmlinuz / vmlinux / Image didn't help

@Famous8
Copy link

Famous8 commented Mar 22, 2024

I downloaded the open source Android 14 kernels for the Tab S8 Ultra from Samsung's website and tried to compile it but my tablet went into a boot loop, so I had to revert back to the previous kernel. I'm just running stock firmware, rooted by Magisk, alongside the stock kernel, which is Android 12.

@subashsn
Copy link

Tried cat /dev/gunyah and got this cat: /dev/gunyah: Invalid argument

Looks like this is where the below error comes from i.e when crosvm tries to use gunyah

apex/com.android.virt/bin/crosvm --log-level=debug run "/data/data/com.termux/files/home/vm2/vmlinux"                                                                             <
[2024-03-23T00:49:49.735761079+05:30 INFO  crosvm] crosvm started.
[2024-03-23T00:49:49.736413214+05:30 INFO  crosvm] CLI arguments parsed.
[2024-03-23T00:49:49.736705610+05:30 DEBUG crosvm::crosvm::sys::unix] creating hypervisor: Gunyah { device: Some("/dev/gunyah") }
[2024-03-23T00:49:49.737004256+05:30 ERROR crosvm] exiting with error 1: failed to create vm

Caused by:
    Invalid argument (os error 22)

Not sure how to resolve this. Would really appreciate your help @quic-cvanscha . Ty!

@luxontw
Copy link

luxontw commented Apr 7, 2024

Tried cat /dev/gunyah and got this cat: /dev/gunyah: Invalid argument

Looks like this is where the below error comes from i.e when crosvm tries to use gunyah

apex/com.android.virt/bin/crosvm --log-level=debug run "/data/data/com.termux/files/home/vm2/vmlinux"                                                                             <
[2024-03-23T00:49:49.735761079+05:30 INFO  crosvm] crosvm started.
[2024-03-23T00:49:49.736413214+05:30 INFO  crosvm] CLI arguments parsed.
[2024-03-23T00:49:49.736705610+05:30 DEBUG crosvm::crosvm::sys::unix] creating hypervisor: Gunyah { device: Some("/dev/gunyah") }
[2024-03-23T00:49:49.737004256+05:30 ERROR crosvm] exiting with error 1: failed to create vm

Caused by:
    Invalid argument (os error 22)

Not sure how to resolve this. Would really appreciate your help @quic-cvanscha . Ty!

https://issuetracker.google.com/issues/280625917
According to conversations between Samsung and Google engineers, Samsung does not plan to enable AVF for their devices, so maybe a different device will be needed!
Or you can try setting the correct permissions for /dev/gunyah.
chmod 660 /dev/gunyah

@Famous8
Copy link

Famous8 commented Apr 7, 2024

I could never do that! I love my tablet too much haha. I'll figure out some way to enable such soon.

@Soranokuni
Copy link

Have you tried with the 6.1 Update?

@Aiman1102-star
Copy link

hi need help on samsung s9 ultra to format manual remove lock can someone help

@wwlWang
Copy link

wwlWang commented Sep 29, 2024

it doesnt work for me, i tried on SD8G3 with oneplus 12, the kernel version is:
Linux localhost 6.1.57-android14-11-o-ga23ceff5d55d #1 SMP PREEMPT Mon Aug 19 11:22:00 UTC 2024 aarch64 Android
try compile crosvm and QEMU with gunyah fork on termux, failed.
compile crosvm on chroot container with command cargo build --features=gunyah, tried run, but got these error:

sudo ./crosvm --log-level=debug run linux --disable-sandbox
syslog init failed: guess of fd for syslog connection was invalid
syslog init failed: guess of fd for syslog connection was invalid
[2024-09-29T03:45:36.341635551+00:00 DEBUG crosvm::crosvm::sys::linux] creating hypervisor: Gunyah { device: Some("/dev/gunyah") }
[2024-09-29T03:45:36.388822478+00:00 ERROR crosvm] exiting with error 1: failed to create vm

Caused by:
    Cannot allocate memory (os error 12)

tried run QEMU got these error

sudo ./qemu-system-aarch64 -nographic --accel gunyah -machine virt
qemu-system-aarch64: failed to add mem (Cannot allocate memory)

looks like doesnt work anymore

@b9Joker108
Copy link

b9Joker108 commented Oct 18, 2024

I got really excited and hopeful, as I was just reading about Gunyah, prior to finding this issue thread and thought I may be able to use Gunyah on my unrooted Samsung Galaxy Tab S9 Ultra, to provision a VM and run Docker. Though, this I understand from this thread is a mere pipedream. The only solution I have so far been able to determine, is to provision a VM on a local or remote server and mount the VM locally in a project directory on the Tab. Then, it is possible to use Docker on the Tab, when not using Docker on the Tab, by mounting the remote VM locally on the Tab, through the project directory, which acts as a portal. To seal the deal, I get to enjoy the privilage of my local environment and shell config. Any other solutions?

@quic-yvasi
Copy link

quic-yvasi commented Oct 18, 2024 via email

@Mikemadise
Copy link

How root my Motorola g14 on termux cli?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests