{"id":24884705,"url":"https://github.com/mutantmonkey/alpine-appvm","last_synced_at":"2025-03-27T09:43:37.811Z","repository":{"id":137959219,"uuid":"41470421","full_name":"mutantmonkey/alpine-appvm","owner":"mutantmonkey","description":"Ansible playbook that sets up \"app VMs\" on Alpine Linux installations","archived":false,"fork":false,"pushed_at":"2016-08-21T22:47:50.000Z","size":25,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T14:37:47.822Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mutantmonkey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-08-27T06:48:33.000Z","updated_at":"2018-09-11T22:12:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"e642d9a5-83a4-48b7-abd6-9b47d94957b4","html_url":"https://github.com/mutantmonkey/alpine-appvm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutantmonkey%2Falpine-appvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutantmonkey%2Falpine-appvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutantmonkey%2Falpine-appvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mutantmonkey%2Falpine-appvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mutantmonkey","download_url":"https://codeload.github.com/mutantmonkey/alpine-appvm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245821982,"owners_count":20678125,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-01T14:33:40.960Z","updated_at":"2025-03-27T09:43:37.803Z","avatar_url":"https://github.com/mutantmonkey.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Alpine-based AppVMs for QEMU\n\n**As of August 2016, I no longer recommend the use of this playbook. Alpine\nLinux has consistently failed to provide Firefox updates in a timely manner and\nis currently two major releases behind. Although I have a lot of hope for\nAlpine, it is unsafe to use it to run Firefox at this time.**\n\nThis is a playbook that helps you create AppVMs using Alpine Linux. Right now,\nonly QEMU is supported with SPICE enabled, but support for other environments\nmay be added in the future.\n\n\n## Getting Started (QEMU without libvirt)\n\nThe following instructions assume your host machine is running Arch Linux and\nthat you wish to run QEMU without using libvirt. Support for other\ndistributions may be added in the future.\n\nDownload and install the basic prerequisites:\n~~~\n$ sudo pacman -S ansible spice qemu python2 sshpass\n~~~\n\nAdd a record for \"appvm-browser\" to the end of your \"~/.ssh/config\" file\n~~~\n...\n\nHost appvm-browser\nHostName localhost\nUser root\nPort 10022\n~~~\n\nDownload the Alpine Linux 64-bit ISO and verify its signature:\n~~~\n$ wget http://alpinelinux.org/keys/ncopa.asc \n$ gpg --import ncopa.asc \ngpg: key 07D9495A: public key \"Natanael Copa \u003cncopa@alpinelinux.org\u003e\" imported\ngpg: Total number processed: 1\ngpg:               imported: 1\n\n$ wget http://wiki.alpinelinux.org/cgi-bin/dl.cgi/v3.2/releases/x86_64/alpine-3.2.3-x86_64.iso \n$ wget http://wiki.alpinelinux.org/cgi-bin/dl.cgi/v3.2/releases/x86_64/alpine-3.2.3-x86_64.iso.asc\n$ gpg --verify alpine-3.2.3-x86_64.iso.asc \ngpg: assuming signed data in 'alpine-3.2.3-x86_64.iso'\ngpg: Signature made Thu 13 Aug 2015 03:21:51 PM UTC using RSA key ID 07D9495A\ngpg: Good signature from \"Natanael Copa \u003cncopa@alpinelinux.org\u003e\" [unknown]\ngpg: WARNING: This key is not certified with a trusted signature!\ngpg:          There is no indication that the signature belongs to the owner.\nPrimary key fingerprint: 0482 D840 22F5 2DF1 C4E7  CD43 293A CD09 07D9 495A\n~~~\n\nClone the alpine-appvm.git repo and navigate to it:\n~~~\n$ git clone https://github.com/mutantmonkey/alpine-appvm.git\n$ cd ./alpine-appvm\n~~~\n\nCreate QEMU image, boot from the Alpine ISO:\n~~~\n$ qemu-img create -f raw alpine-appvm.img 4G\nFormatting 'alpine-appvm.img', fmt=raw size=4294967296\n\n$ qemu-system-x86_64 -m 1G \\\n                     -enable-kvm \\\n                     -cdrom ./alpine-3.2.3-x86_64.iso \\\n                     -boot order=d \\\n                     alpine-appvm.img\n(a QEMU window will pop up)\n~~~\n\nOnce the QEMU virtual machine starts, install Alpine Linux to it:\n~~~ \n(from the QEMU guest:)\n\nlocalhost login: root\n\n....\n\nlocalhost ~# setup-alpine\n               (go through installation or use the example 'setup-alpine.conf' with -f)\n\n             ....\n\n             Installation is complete. Please reboot.\n\nhostname  ~# poweroff\n~~~\n\nStart the VM again, booting from the 'alpine-appvm.img' disk image:\n~~~\n$ qemu-system-x86_64 -m 1G \\\n                     -enable-kvm \\\n                     -net nic \\\n                     -net user,hostfwd=tcp::10022-:22 \\\n                     -vga qxl \\\n                     -spice port=5900,addr=127.0.0.1,disable-ticketing \\\n                     alpine-appvm.img\n\n  (this time nothing pops up)\n~~~\n\nSSH into the VM and install a few dependencies:\n~~~\n$ ssh appvm-browser \"apk add sudo python\"\n~~~\n\nRun the Ansible Playbook:\n~~~\n$ source $ANSIBLE_DIR/hacking/env-setup\n$ python2 $ANSIBLE_DIR/bin/ansible-playbook -i hosts --ask-pass browser.yml\n\n    (you should be prompted for the SSH password you set with 'setup-alpine'.)\n\n    ....it runs for a while....\n\n    At the end, you should have a status message like this:\n\n    PLAY RECAP *********************************************************************\n    appvm-browser              : ok=52   changed=40   unreachable=0    failed=0\n~~~\n\nPower down the VM:\n~~~\n$ ssh appvm-browser \"poweroff\"\n~~~\n\nWait for your other QEMU process to exit, start it again with additional \nvdagent parameters, and connect to it with spicec:\n~~~\n$ qemu-system-x86_64 -m 1G \\\n                     -enable-kvm \\\n                     -net nic,model=virtio \\\n                     -net user \\\n                     -vga qxl \\\n                     -spice port=5900,addr=127.0.0.1,disable-ticketing \\\n                     -device virtio-serial-pci \\\n                     -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 \\\n                     -chardev spicevmc,id=spicechannel0,name=vdagent \\\n                     alpine-appvm.img\n\n$ spicec -h 127.0.0.1 -p 5900\n(Warning: Shift-F12 releases the cursor in Spice, not ctrl-alt as in QEMU!)\n\nSpice should bring you to the same login screen as before. Login with \n\"root\" and the password you set during installation and run: \"reboot\".\n~~~\n\nIf the installation was successful, upon reboot your spicec \nclient should show a Firefox browser window. You're done!\n\n\n## Final Notes\n* Once you configure your browser (add extensions, tweak preferences, etc), \n  if you add an additional \"-snapshot\" parameter to QEMU's launch command,\n  changes made in the QEMU session will not be saved to the image \n  stored on disk!\n* When creating the VM, you should add a RNG that passes /dev/random from \n  the host to the guest to improve the available entropy pool.\n\n## Additional Documentation \u0026 Resources\n* [Ansible documentation](http://docs.ansible.com)\n* [Enabling KVM](https://wiki.archlinux.org/index.php/QEMU#Enabling_KVM)\n* [Alpine Linux](http://www.alpinelinux.org/)\n* [Using SPICE and QXL](http://www.linux-kvm.org/page/SPICE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmutantmonkey%2Falpine-appvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmutantmonkey%2Falpine-appvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmutantmonkey%2Falpine-appvm/lists"}