Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
xoureldeen committed Aug 28, 2024
1 parent a88504f commit 250d795
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 8 deletions.
50 changes: 49 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,49 @@
What should i type here?
<p align="center">
<img src="resources/vectrasvm.png" style="width: 30%;" />
</p>

# Vectras VM
[![Ceasefire Now](https://badge.techforpalestine.org/default)](https://techforpalestine.org/learn-more)

[![Telegram Channel][ico-telegram]][link-telegram]
[![Latest Version][ico-version]][link-releases]
[![Software License][ico-license]](LICENSE.md)

Welcome to Vectras VM! A virtual machine app for Android based on QEMU that let you emulate various OS including: Windows, MacOS, Linux and Android.

If you want help you can go through [our documention](https://vectrasvm.blackstorm.cc/how.html). If you are short in time, you could get a straight to the point answer in [Vectras Telegram group](http://t.me/vectras_vm_discussion)

# Installation
> [!NOTE]
> Starting from 2.8, there will be no official support for ARMv7 devices.
You can either download Vectras VM from [releases](https://github.com/epicstudios856/Vectras-VM-Android/releases) or [official website](https://vectrasvm.blackstorm.cc/download.html).

[![OpenAPK](https://www.openapk.net/images/openapk-badge.png)](https://www.openapk.net/vectras-vm/com.vectras.vm/)

### Minimum System Requirement
- Android 5.0 and up
- 3GB RAM (1GB of free RAM)
- ARM64-v8A or X86_64 devices only
- A good processor
> [!TIP]
> If the OS you are trying to emulate crashed, try with an older version.
# Donate
Help support the project by funding it.
<p><a href="https://www.buymeacoffee.com/vectrasvm" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="35" width="168"></a> <a href='https://ko-fi.com/vectrasvm' target='_blank'><img height='35' style='border:0px;height:46px;' src='https://az743702.vo.msecnd.net/cdn/kofi3.png?v=0' border='0' alt='Buy Me a Coffee at ko-fi.com' /></p>


# Thanks to
- [QEMU](https://github.com/qemu/qemu)
- [3DFX QEMU PATCH](https://github.com/kjliew/qemu-3dfx)
- [PROOT](https://proot-me.github.io/)
- [Alpine Linux](https://www.alpinelinux.org/)

[ico-telegram]: https://raw.githubusercontent.com/epicstudios856/Vectras-windows-emulator/main/res/images/telegram.svg
[ico-version]: https://raw.githubusercontent.com/epicstudios856/Vectras-windows-emulator/main/res/images/version.svg
[ico-license]: https://img.shields.io/badge/License-GPL_v2-blue.svg

[link-telegram]: https://t.me/vectras_os
[link-repo]: https://github.com/epicstudios856/Vectras-VM-Android/
[link-releases]: https://github.com/epicstudios856/Vectras-VM-Android/releases/
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
xmlns:tools="http://schemas.android.com/tools"
android:sharedUserId="com.vectras.shared">

<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/vectras/qemu/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class Config {
public static boolean enableSMPOnlyOnKVM = false;

//set to true if you need to debug native library loading
public static boolean loadNativeLibsEarly = false;
public static boolean loadNativeLibsEarly = false;

//XXX: QEMU 3.1.0 needs the libraries to be loaded from the main thread
public static boolean loadNativeLibsMainThread = true;
Expand Down Expand Up @@ -174,7 +174,7 @@ public static enum MouseMode {

public static String machinename = "VECTRAS";
public static int paused = 0;
public static String ui = "VNC";
public static String ui = "X11";
public static boolean maxPriority = false;
public static final String defaultVNCColorMode = COLORMODEL.C24bit.nameString();
public static final ScaleType defaultFullscreenScaleMode = ScaleType.FIT_CENTER;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ public static void setVmUi(Activity activity, String vmUi) {

public static String getVmUi(Activity activity) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
return prefs.getString("vmUi", "VNC");
return prefs.getString("vmUi", Config.ui);
}

public static void setResolution(Activity activity, String RESOLUTION) {
Expand Down
19 changes: 18 additions & 1 deletion app/src/main/java/com/vectras/vm/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.app.Dialog;
import android.app.NotificationManager;
import android.app.ProgressDialog;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
Expand All @@ -22,6 +23,7 @@
import android.os.Environment;
import android.os.Handler;
import android.provider.DocumentsContract;
import android.system.ErrnoException;
import android.text.Html;
import android.util.Log;
import android.view.Menu;
Expand Down Expand Up @@ -67,6 +69,7 @@
import com.vectras.vm.MainRoms.AdapterMainRoms;
import com.vectras.vm.MainRoms.DataMainRoms;
import com.vectras.vm.adapter.LogsAdapter;
import com.vectras.vm.core.TermuxX11;
import com.vectras.vm.logger.VectrasStatus;
import com.vectras.vm.utils.AppUpdater;
import com.vectras.vm.utils.FileUtils;
Expand Down Expand Up @@ -788,7 +791,21 @@ public void run() {
} else if (MainSettingsManager.getVmUi(activity).equals("SPICE")) {
//activity.startActivity(new Intent(activity, RemoteCanvasActivity.class));
} else if (MainSettingsManager.getVmUi(activity).equals("X11")) {
//activity.startActivity(new Intent(activity, X11Activity.class));
try {
TermuxX11.main(new String[]{":0"});
} catch (ErrnoException e) {
throw new RuntimeException(e);
}

Intent x11Intent = new Intent();
x11Intent.setClassName("com.termux.x11", "com.termux.x11.MainActivity");
x11Intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

try {
activity.startActivity(x11Intent);
} catch (ActivityNotFoundException e) {
Log.e("LaunchActivity", "Activity not found: " + e.getMessage());
}
}

}
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/com/vectras/vm/StartVM.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public static String env(Activity activity, String extras, String img, String cp

ArrayList<String> params = new ArrayList<>(Arrays.asList(qemu));

params.add("awesome;");

if (MainSettingsManager.getArch(activity).equals("I386"))
params.add("qemu-system-i386");
else if (MainSettingsManager.getArch(activity).equals("X86_64"))
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/vectras/vm/core/TermuxX11.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class TermuxX11 {

public static void main(String[] args) throws ErrnoException {
String filesDir = VectrasApp.vectrasapp.getFilesDir().getAbsolutePath();
File xkbConfigRoot = new File(filesDir + "/distro/share/X11/xkb");
File xkbConfigRoot = new File(filesDir + "/distro/usr/share/X11/xkb");
if (!xkbConfigRoot.exists())
throw new RuntimeException("XKB_CONFIG_ROOT not found: " + xkbConfigRoot);
Os.setenv("XKB_CONFIG_ROOT", xkbConfigRoot.getAbsolutePath(), true);
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/java/com/vectras/vterm/Terminal.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class Terminal {
private String user = "root";

public static Process qemuProcess;
public static String DISPLAY = ":1";
public static String DISPLAY = ":0";

public Terminal(Context context) {
this.context = context;
Expand Down Expand Up @@ -108,6 +108,9 @@ public void executeShellCommand(String userCommand, boolean showResultDialog, Ac
"-b", "/storage",
"-b", "/data",
"-w", "/root",
"/usr/bin/env", "-i",
"HOME=/root",
"DISPLAY="+DISPLAY,
"/bin/sh",
"--login"// The shell to execute inside PRoot
};
Expand Down

0 comments on commit 250d795

Please sign in to comment.