From dde2255b57c00769ec07282277aabfeaca16b29e Mon Sep 17 00:00:00 2001 From: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com> Date: Thu, 27 Jul 2023 11:32:58 +0200 Subject: [PATCH 1/7] feat: quickemu install script --- scripts/install_quickemu | 114 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 scripts/install_quickemu diff --git a/scripts/install_quickemu b/scripts/install_quickemu new file mode 100644 index 0000000..582a2a1 --- /dev/null +++ b/scripts/install_quickemu @@ -0,0 +1,114 @@ +#!/usr/bin/env python3 + +import platform +import os +import shutil +import sys + + +def clone_repo(): + print("📦 Cloning quickemu...") + + print("> git clone --filter=blob:none https://github.com/wimpysworld/quickemu /tmp/quickemu") + os.system("git clone --filter=blob:none https://github.com/wimpysworld/quickemu /tmp/quickemu") + + print("> mkdir -p ~/.local/bin") + os.system("mkdir -p ~/.local/bin") + + print("> mv /tmp/quickemu/quickemu ~/.local/bin") + os.system("mv /tmp/quickemu/quickemu ~/.local/bin") + + print("> mv /tmp/quickemu/macrecovery ~/.local/bin") + os.system("mv /tmp/quickemu/macrecovery ~/.local/bin") + + print("> mv /tmp/quickemu/quickget ~/.local/bin") + os.system("mv /tmp/quickemu/quickget ~/.local/bin") + + print("> mv /tmp/quickemu/windowskey ~/.local/bin") + os.system("mv /tmp/quickemu/windowskey ~/.local/bin") + + print("> rm -rf /tmp/quickemu") + os.system("rm -rf /tmp/quickemu") + + print("Installation complete.") + print("⚠️ Make sure ~/.local/bin is in your PATH.") + + +def install_fedora(): + print("📦 Installing dependencies...") + + cmd = "sudo dnf install qemu bash coreutils edk2-tools grep jq lsb procps python3 genisoimage usbutils util-linux " \ + "sed spice-gtk-tools swtpm wget xdg-user-dirs xrandr unzip socat -y" + print("> " + cmd) + os.system(cmd) + + clone_repo() + + sys.exit(0) + + +def install_deb(): + print("📦 Installing dependencies...") + + print("> sudo apt update") + os.system("sudo apt update") + + cmd = "sudo apt install qemu bash coreutils ovmf grep jq lsb-base procps python3 genisoimage usbutils util-linux " \ + "sed spice-client-gtk libtss2-tcti-swtpm0 wget xdg-user-dirs zsync unzip socat -y" + print("> " + cmd) + os.system(cmd) + + clone_repo() + + sys.exit(0) + + +def install_ubuntu(): + print("⚠️ Adding ppa...") + + print("> sudo apt-add-repository ppa:flexiondotorg/quickemu") + os.system("sudo apt-add-repository ppa:flexiondotorg/quickemu") + + print("> sudo apt update") + os.system("sudo apt update") + + print("> sudo apt install quickemu -y") + os.system("sudo apt install quickemu -y") + + sys.exit(0) + + +if __name__ == "__main__": + print("⚠️ This script requires elevated privileges (sudo). You will be asked for your password.") + + os_release = platform.freedesktop_os_release() + + distro_id = os_release.get("ID_LIKE") + distro_id_like = os_release.get("ID") + + if not distro_id and not distro_id_like: + print("❌ Couldn't fetch distro, is os-release installed?") + + if distro_id == "ubuntu" \ + or distro_id_like == "ubuntu": + install_ubuntu() + elif distro_id == "debian" \ + or distro_id_like == "debian" \ + or shutil.which("apt"): + install_deb() + elif distro_id == "fedora" \ + or distro_id_like == "fedora" \ + or shutil.which("dnf"): + install_fedora() + else: + if distro_id: + print("❌ Unsupported distro: ", distro_id) + elif distro_id_like: + print("❌ Unsupported distro: ", distro_id_like) + else: + print("❌ Unsupported distro. Couldn't fetch data from os-release and couldn't find dnf or apt on PATH.") + + sys.exit(1) + + print("❌ Unsupported platform.") + sys.exit(1) From da55fcc2edc947dd9d014eedefb0d7894647f8be Mon Sep 17 00:00:00 2001 From: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com> Date: Thu, 27 Jul 2023 11:33:22 +0200 Subject: [PATCH 2/7] feat: create and start vm via quickemu --- winapps-cli/src/main.rs | 11 +++++++ winapps/src/lib.rs | 2 ++ winapps/src/quickemu.rs | 66 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 winapps/src/quickemu.rs diff --git a/winapps-cli/src/main.rs b/winapps-cli/src/main.rs index a7af7dd..98e3d63 100644 --- a/winapps-cli/src/main.rs +++ b/winapps-cli/src/main.rs @@ -1,4 +1,5 @@ use clap::Command; +use winapps::quickemu::{create_vm, run_vm}; fn cli() -> Command { Command::new("winapps-cli") @@ -8,6 +9,8 @@ fn cli() -> Command { .allow_external_subcommands(true) .subcommand(Command::new("check").about("Checks remote connection")) .subcommand(Command::new("connect").about("Connects to remote")) + .subcommand(Command::new("create-vm").about("Create a windows 10 vm using quickemu")) + .subcommand(Command::new("run-vm").about("Start the vm using quickemu")) } fn main() { @@ -23,6 +26,14 @@ fn main() { Some(("connect", _)) => { println!("Connecting to remote"); } + Some(("create-vm", _)) => { + println!("Creating windows 10 vm.."); + create_vm(); + } + Some(("run-vm", _)) => { + println!("Starting vm.."); + run_vm(); + } Some((_, _)) => { cli.about("Command not found, try existing ones!") .print_help() diff --git a/winapps/src/lib.rs b/winapps/src/lib.rs index 8e6937b..9ed98cc 100644 --- a/winapps/src/lib.rs +++ b/winapps/src/lib.rs @@ -1,3 +1,5 @@ +pub mod quickemu; + use derive_new::new; use home::home_dir; use serde::{Deserialize, Serialize}; diff --git a/winapps/src/quickemu.rs b/winapps/src/quickemu.rs new file mode 100644 index 0000000..e5a534a --- /dev/null +++ b/winapps/src/quickemu.rs @@ -0,0 +1,66 @@ +use home::home_dir; +use std::path::PathBuf; +use std::process::exit; +use std::process::Command; + +pub(crate) fn get_data_dir() -> PathBuf { + let home = home_dir().expect("Could not find the home path!"); + let data_dir = home.join(".local/share/winapps"); + + if !data_dir.exists() { + let dir = data_dir.clone(); + println!( + "Data directory {:?} does not exist! Creating...", + dir.to_str() + ); + std::fs::create_dir_all(dir).expect("Failed to create directory"); + } + + if !data_dir.is_dir() { + panic!("Data directory {:?} is not a directory!", data_dir.to_str()); + } + + data_dir +} + +pub fn create_vm() { + let data_dir = get_data_dir(); + + let output = match Command::new("quickget") + .current_dir(data_dir) + .arg("windows") + .arg("10") + .output() + { + Ok(o) => o, + Err(e) => { + println!("Failed to execute quickget: {}", e); + println!("Please make sure quickget is installed and in your PATH"); + exit(1); + } + }; + + println!("{}", String::from_utf8_lossy(&output.stdout)); +} + +pub fn run_vm() { + let data_dir = get_data_dir(); + + let output = match Command::new("quickemu") + .current_dir(data_dir) + .arg("--vm") + .arg("windows-10-22H2.conf") + .spawn() + .unwrap() + .wait_with_output() + { + Ok(o) => o, + Err(e) => { + println!("Failed to execute quickemu: {}", e); + println!("Please make sure quickemu is installed and in your PATH"); + exit(1); + } + }; + + println!("{}", String::from_utf8_lossy(&output.stdout)); +} From 6b730e8cb12f180a2edb9e18089eaac90088e4f9 Mon Sep 17 00:00:00 2001 From: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com> Date: Tue, 12 Sep 2023 15:47:08 +0200 Subject: [PATCH 3/7] feat: stopping the vm --- winapps-cli/src/main.rs | 46 ++++++++++++++++++++++++++++++++--------- winapps/src/quickemu.rs | 42 ++++++++++++++++++++++++++++++++----- 2 files changed, 73 insertions(+), 15 deletions(-) diff --git a/winapps-cli/src/main.rs b/winapps-cli/src/main.rs index d77149f..04aa573 100644 --- a/winapps-cli/src/main.rs +++ b/winapps-cli/src/main.rs @@ -1,6 +1,6 @@ use clap::Command; use winapps::freerdp::freerdp_back::Freerdp; -use winapps::quickemu::{create_vm, run_vm}; +use winapps::quickemu::{create_vm, kill_vm, start_vm}; use winapps::RemoteClient; fn cli() -> Command { @@ -11,8 +11,16 @@ fn cli() -> Command { .allow_external_subcommands(true) .subcommand(Command::new("check").about("Checks remote connection")) .subcommand(Command::new("connect").about("Connects to remote")) - .subcommand(Command::new("create-vm").about("Create a windows 10 vm using quickemu")) - .subcommand(Command::new("run-vm").about("Start the vm using quickemu")) + .subcommand( + Command::new("vm") + .about("Manage a windows 10 vm using quickemu") + .subcommand_required(true) + .arg_required_else_help(true) + .allow_external_subcommands(true) + .subcommand(Command::new("create").about("Create a windows 10 vm using quickget")) + .subcommand(Command::new("start").about("Start the vm")) + .subcommand(Command::new("kill").about("Kill the running VM")), + ) } fn main() { @@ -34,14 +42,32 @@ fn main() { let config = winapps::load_config(None); client.run_app(config, "explorer"); } - Some(("create-vm", _)) => { - println!("Creating windows 10 vm.."); - create_vm(); - } - Some(("run-vm", _)) => { - println!("Starting vm.."); - run_vm(); + + Some(("vm", command)) => { + match command.subcommand() { + Some(("create", _)) => { + println!("Creating windows 10 vm.."); + create_vm(); + } + Some(("start", _)) => { + println!("Starting vm.."); + start_vm(); + } + + Some(("kill", _)) => { + println!("Killing vm.."); + kill_vm(); + } + + Some((_, _)) => { + cli.about("Command not found, try existing ones!") + .print_help() + .expect("Couldn't print help"); + } + _ => unreachable!(), + }; } + Some((_, _)) => { cli.about("Command not found, try existing ones!") .print_help() diff --git a/winapps/src/quickemu.rs b/winapps/src/quickemu.rs index 770235c..8e979d3 100644 --- a/winapps/src/quickemu.rs +++ b/winapps/src/quickemu.rs @@ -1,5 +1,6 @@ use home::home_dir; use std::env; +use std::fs; use std::path::PathBuf; use std::process::exit; use std::process::Command; @@ -51,17 +52,15 @@ pub fn create_vm() { println!("{}", String::from_utf8_lossy(&output.stdout)); } -pub fn run_vm() { +pub fn start_vm() { let data_dir = get_data_dir(); - let output = match Command::new("quickemu") + let command = match Command::new("quickemu") .current_dir(data_dir) .args(["--vm", "windows-10-22H2.conf", "--display", "none"]) .spawn() - .unwrap() - .wait_with_output() { - Ok(o) => o, + Ok(c) => c, Err(e) => { println!("Failed to execute quickemu: {}", e); println!("Please make sure quickemu is installed and in your PATH"); @@ -69,5 +68,38 @@ pub fn run_vm() { } }; + let output = match command.wait_with_output() { + Ok(o) => o, + Err(e) => { + println!("Failed to gather output from quickemu: {}", e); + println!("Please make sure quickemu is installed and in your PATH"); + exit(1); + } + }; + println!("{}", String::from_utf8_lossy(&output.stdout)); } + +pub fn kill_vm() { + let data_dir = get_data_dir(); + + match fs::read_to_string(data_dir.join("windows-10/windows-10-22H2.pid")) { + Ok(pid) => { + let pid = pid.trim(); + + println!("Killing VM with PID {}", pid); + + match Command::new("kill").arg(pid).spawn() { + Ok(_) => (), + Err(e) => { + println!("Failed to kill VM: {}", e); + exit(1); + } + } + } + Err(e) => { + println!("Failed to read PID file: {}", e); + exit(1); + } + } +} From 6ab6b73adbbe15566d2197d45db2087cfeb45387 Mon Sep 17 00:00:00 2001 From: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com> Date: Mon, 2 Oct 2023 18:11:15 +0200 Subject: [PATCH 4/7] fix: clean up config file & data dir loading --- winapps/src/lib.rs | 91 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 77 insertions(+), 14 deletions(-) diff --git a/winapps/src/lib.rs b/winapps/src/lib.rs index 6be8f55..41347d6 100644 --- a/winapps/src/lib.rs +++ b/winapps/src/lib.rs @@ -1,8 +1,10 @@ pub mod quickemu; use derive_new::new; +use home::home_dir; use serde::{Deserialize, Serialize}; use std::io::Write; +use std::path::PathBuf; use std::{ env, fs::{self, File}, @@ -23,6 +25,16 @@ pub struct Config { host: HostConfig, #[new(value = "RemoteConfig::new()")] rdp: RemoteConfig, + #[new(value = "VmConfig::new()")] + vm: VmConfig, +} + +#[derive(new, Debug, Deserialize, Serialize)] +pub struct VmConfig { + #[new(value = "\"windows-10\".to_string()")] + short_name: String, + #[new(value = "\"windows-10-22H2\".to_string()")] + name: String, } #[derive(new, Debug, Deserialize, Serialize)] @@ -43,35 +55,86 @@ pub struct RemoteConfig { password: String, } -pub fn load_config(path: Option<&str>) -> Config { - let config = env::var("XDG_CONFIG_HOME").expect("Could not find the home path!"); - let default = &format!("{}{}", config, "/winapps/"); - let path = Path::new(path.unwrap_or(default)); - let config = Config::new(); +pub fn get_config_file(path: Option<&str>) -> PathBuf { + let default = match env::var("XDG_CONFIG_HOME") { + Ok(dir) => PathBuf::from(dir).join("winapps"), + Err(_) => { + println!("Couldn't read XDG_CONFIG_HOME, falling back to ~/.config"); + home_dir() + .expect("Could not find the home path!") + .join(".config/winapps") + } + }; + + let path = Path::new(path.unwrap_or(default.to_str().unwrap())); if !path.exists() { - println!("{:?} does not exist! Creating...", path.to_str()); + println!("{:?} does not exist! Creating...", path); fs::create_dir_all(path).expect("Failed to create directory"); } - let config_file = path.join("config.toml"); + if !path.is_dir() { + panic!("Config directory {:?} is not a directory!", path); + } + + path.join("config.toml") +} - if !config_file.exists() { - let mut config_file = - File::create(&config_file).expect("Failed to create configuration file"); +pub fn load_config(path: Option<&str>) -> Config { + let config = Config::new(); + let config_path = get_config_file(path); - let gen_config = - toml::to_string(&config).expect("Failed to generate default configuration"); - write!(config_file, "{}", gen_config).expect("Failed to write configuration file"); + if !config_path.exists() { + save_config(&config, path).expect("Failed to write default configuration"); + return config; } - let config_file = fs::read_to_string(config_file).expect("Failed to read configuration file"); + let config_file = fs::read_to_string(config_path).expect("Failed to read configuration file"); let config: Config = toml::from_str(config_file.as_str()).expect("Failed to parse the configuration"); config } +pub fn save_config(config: &Config, path: Option<&str>) -> std::io::Result<()> { + let config_path = get_config_file(path); + let serialized_config = toml::to_string(&config).expect("Failed to serialize configuration"); + + let mut config_file = match config_path.exists() { + true => File::open(&config_path).expect("Failed to open configuration file"), + false => File::create(&config_path).expect("Failed to create configuration file"), + }; + + write!(config_file, "{}", serialized_config) +} + +pub fn get_data_dir() -> PathBuf { + let data_dir = match env::var("XDG_DATA_HOME") { + Ok(dir) => PathBuf::from(dir).join("winapps"), + Err(_) => { + println!("Couldn't read XDG_DATA_HOME, falling back to ~/.local/share"); + home_dir() + .expect("Could not find the home path!") + .join(".local/share/winapps") + } + }; + + if !data_dir.exists() { + let dir = data_dir.clone(); + println!( + "Data directory {:?} does not exist! Creating...", + dir.to_str() + ); + fs::create_dir_all(dir).expect("Failed to create directory"); + } + + if !data_dir.is_dir() { + panic!("Data directory {:?} is not a directory!", data_dir); + } + + data_dir +} + pub fn add(left: usize, right: usize) -> usize { left + right } From 62421176293b93cb22388ba1d1c091a7da9f9f32 Mon Sep 17 00:00:00 2001 From: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com> Date: Mon, 2 Oct 2023 18:11:32 +0200 Subject: [PATCH 5/7] feat: make vm name configurable --- winapps-cli/src/main.rs | 11 ++++----- winapps/src/quickemu.rs | 53 ++++++++++++++--------------------------- 2 files changed, 22 insertions(+), 42 deletions(-) diff --git a/winapps-cli/src/main.rs b/winapps-cli/src/main.rs index 04aa573..d880054 100644 --- a/winapps-cli/src/main.rs +++ b/winapps-cli/src/main.rs @@ -27,19 +27,16 @@ fn main() { let cli = cli(); let matches = cli.clone().get_matches(); + let config = winapps::load_config(None); let client: &dyn RemoteClient = &Freerdp {}; match matches.subcommand() { Some(("check", _)) => { println!("Checking remote connection"); - - let config = winapps::load_config(None); client.check_depends(config); } Some(("connect", _)) => { println!("Connecting to remote"); - - let config = winapps::load_config(None); client.run_app(config, "explorer"); } @@ -47,16 +44,16 @@ fn main() { match command.subcommand() { Some(("create", _)) => { println!("Creating windows 10 vm.."); - create_vm(); + create_vm(config); } Some(("start", _)) => { println!("Starting vm.."); - start_vm(); + start_vm(config); } Some(("kill", _)) => { println!("Killing vm.."); - kill_vm(); + kill_vm(config); } Some((_, _)) => { diff --git a/winapps/src/quickemu.rs b/winapps/src/quickemu.rs index 8e979d3..00b9feb 100644 --- a/winapps/src/quickemu.rs +++ b/winapps/src/quickemu.rs @@ -1,38 +1,9 @@ -use home::home_dir; -use std::env; +use crate::{get_data_dir, save_config, Config}; use std::fs; -use std::path::PathBuf; use std::process::exit; use std::process::Command; -pub fn get_data_dir() -> PathBuf { - let home = home_dir().expect("Could not find the home path!"); - - let data_dir = match env::var("XDG_DATA_HOME") { - Ok(dir) => PathBuf::from(dir).join("winapps"), - Err(_) => { - println!("Couldn't read XDG_DATA_HOME, falling back to ~/.local/share"); - home.join(".local/share/winapps") - } - }; - - if !data_dir.exists() { - let dir = data_dir.clone(); - println!( - "Data directory {:?} does not exist! Creating...", - dir.to_str() - ); - std::fs::create_dir_all(dir).expect("Failed to create directory"); - } - - if !data_dir.is_dir() { - panic!("Data directory {:?} is not a directory!", data_dir.to_str()); - } - - data_dir -} - -pub fn create_vm() { +pub fn create_vm(mut config: Config) { let data_dir = get_data_dir(); let output = match Command::new("quickget") @@ -49,15 +20,25 @@ pub fn create_vm() { } }; + config.vm.name = "windows-10-22H2".to_string(); + config.vm.short_name = "windows-10".to_string(); + + save_config(&config, None).expect("Failed to save config, VM will not start properly"); + println!("{}", String::from_utf8_lossy(&output.stdout)); } -pub fn start_vm() { +pub fn start_vm(config: Config) { let data_dir = get_data_dir(); let command = match Command::new("quickemu") .current_dir(data_dir) - .args(["--vm", "windows-10-22H2.conf", "--display", "none"]) + .args([ + "--vm", + &format!("{}.conf", config.vm.name), + "--display", + "none", + ]) .spawn() { Ok(c) => c, @@ -80,10 +61,12 @@ pub fn start_vm() { println!("{}", String::from_utf8_lossy(&output.stdout)); } -pub fn kill_vm() { +pub fn kill_vm(config: Config) { let data_dir = get_data_dir(); - match fs::read_to_string(data_dir.join("windows-10/windows-10-22H2.pid")) { + match fs::read_to_string( + data_dir.join(format!("{}/{}.pid", config.vm.short_name, config.vm.name)), + ) { Ok(pid) => { let pid = pid.trim(); From 851a67d5d3b6d802490bbbe1dc7f1473fca28a22 Mon Sep 17 00:00:00 2001 From: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com> Date: Sun, 8 Oct 2023 14:42:25 +0200 Subject: [PATCH 6/7] feat: clone quickemu into ~/.local/share/quickemu and symlink binaries --- scripts/install_quickemu | 68 +++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 36 deletions(-) diff --git a/scripts/install_quickemu b/scripts/install_quickemu index 84fe732..efaba95 100644 --- a/scripts/install_quickemu +++ b/scripts/install_quickemu @@ -6,41 +6,46 @@ import shutil import sys -def clone_repo(): - print("📦 Cloning quickemu...") +def _(c: str): + """Execute the command `c` and print it""" + print("> " + c) + os.system(c) - print("> git clone --filter=blob:none https://github.com/quickemu-project/quickemu /tmp/quickemu") - os.system("git clone --filter=blob:none https://github.com/quickemu-project/quickemu /tmp/quickemu") - print("> mkdir -p ~/.local/bin") - os.system("mkdir -p ~/.local/bin") +def clone_repo(): + if os.path.exists(os.path.expanduser("~/.local/share/quickemu")): + print("📦 quickemu is already installed. Updating...") + update_quickemu() + return - print("> mv /tmp/quickemu/quickemu ~/.local/bin") - os.system("mv /tmp/quickemu/quickemu ~/.local/bin") + print("📦 Cloning quickemu...") - print("> mv /tmp/quickemu/macrecovery ~/.local/bin") - os.system("mv /tmp/quickemu/macrecovery ~/.local/bin") + _("git clone --filter=blob:none https://github.com/quickemu-project/quickemu ~/.local/share/quickemu") + _("mkdir -p ~/.local/bin") + _("ln -s ~/.local/share/quickemu/quickemu ~/.local/bin/quickemu") + _("ln -s ~/.local/share/quickemu/macrecovery ~/.local/bin/macrecovery") + _("ln -s ~/.local/share/quickemu/quickget ~/.local/bin/quickget") + _("ln -s ~/.local/share/quickemu/windowskey ~/.local/bin/windowskey") - print("> mv /tmp/quickemu/quickget ~/.local/bin") - os.system("mv /tmp/quickemu/quickget ~/.local/bin") + print("Installation complete.") + print("⚠️ Make sure ~/.local/bin is in your PATH.") - print("> mv /tmp/quickemu/windowskey ~/.local/bin") - os.system("mv /tmp/quickemu/windowskey ~/.local/bin") - print("> rm -rf /tmp/quickemu") - os.system("rm -rf /tmp/quickemu") +def update_quickemu(): + print("📦 Updating quickemu...") - print("Installation complete.") + _("cd ~/.local/share/quickemu") + _("git pull") + + print("Update complete.") print("⚠️ Make sure ~/.local/bin is in your PATH.") def install_fedora(): print("📦 Installing dependencies...") - cmd = "sudo dnf install qemu bash coreutils edk2-tools grep jq lsb procps python3 genisoimage usbutils util-linux " \ - "sed spice-gtk-tools swtpm wget xdg-user-dirs xrandr unzip socat -y" - print("> " + cmd) - os.system(cmd) + _("sudo dnf install qemu bash coreutils edk2-tools grep jq lsb procps python3 genisoimage usbutils" + + " util-linux sed spice-gtk-tools swtpm wget xdg-user-dirs xrandr unzip socat -y") clone_repo() @@ -50,13 +55,9 @@ def install_fedora(): def install_deb(): print("📦 Installing dependencies...") - print("> sudo apt update") - os.system("sudo apt update") - - cmd = "sudo apt install qemu bash coreutils ovmf grep jq lsb-base procps python3 genisoimage usbutils util-linux " \ - "sed spice-client-gtk libtss2-tcti-swtpm0 wget xdg-user-dirs zsync unzip socat -y" - print("> " + cmd) - os.system(cmd) + _("sudo apt update") + _("sudo apt install qemu bash coreutils ovmf grep jq lsb-base procps python3 genisoimage usbutils" + + " util-linux sed spice-client-gtk libtss2-tcti-swtpm0 wget xdg-user-dirs zsync unzip socat -y") clone_repo() @@ -66,14 +67,9 @@ def install_deb(): def install_ubuntu(): print("⚠️ Adding ppa...") - print("> sudo apt-add-repository ppa:flexiondotorg/quickemu") - os.system("sudo apt-add-repository ppa:flexiondotorg/quickemu") - - print("> sudo apt update") - os.system("sudo apt update") - - print("> sudo apt install quickemu -y") - os.system("sudo apt install quickemu -y") + _("sudo apt-add-repository ppa:flexiondotorg/quickemu") + _("sudo apt update") + _("sudo apt install quickemu -y") sys.exit(0) From 00b814aae19ff36cac670a0d11fd0d3ac4de2f77 Mon Sep 17 00:00:00 2001 From: Oskar Manhart <52569953+oskardotglobal@users.noreply.github.com> Date: Sun, 8 Oct 2023 14:43:25 +0200 Subject: [PATCH 7/7] feat: always ignore msrs --- winapps/src/quickemu.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/winapps/src/quickemu.rs b/winapps/src/quickemu.rs index 00b9feb..73b3300 100644 --- a/winapps/src/quickemu.rs +++ b/winapps/src/quickemu.rs @@ -34,6 +34,7 @@ pub fn start_vm(config: Config) { let command = match Command::new("quickemu") .current_dir(data_dir) .args([ + "--ignore-msrs-always", "--vm", &format!("{}.conf", config.vm.name), "--display",