├── osinfo-db.rb ├── osinfo-db-tools.rb ├── virt-viewer.rb ├── README.md └── virt-manager.rb /osinfo-db.rb: -------------------------------------------------------------------------------- 1 | class OsinfoDb < Formula 2 | desc "Libosinfo database files" 3 | homepage "https://libosinfo.org/" 4 | url "https://releases.pagure.org/libosinfo/osinfo-db-20191125.tar.xz" 5 | sha256 "e8f4e8c3e3ee738191511a4549fc8e4895b501312f2a7d383d5bde72a76f5580" 6 | 7 | depends_on "osinfo-db-tools" => :build 8 | 9 | def install 10 | system "osinfo-db-import", "--local", cached_download 11 | 12 | # Copy the archive into the prefix to avoid empty installation error 13 | cp_r "./", prefix 14 | end 15 | 16 | test do 17 | system "osinfo-db-validate", "--local" 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /osinfo-db-tools.rb: -------------------------------------------------------------------------------- 1 | class OsinfoDbTools < Formula 2 | desc "Tools for managing the libosinfo database files" 3 | homepage "https://libosinfo.org" 4 | url "https://releases.pagure.org/libosinfo/osinfo-db-tools-1.6.0.tar.gz" 5 | sha256 "d0d5b1196d73a7abed051be48d0e5b4aa196aac4cdbf8ddf52f57c0c492b2574" 6 | 7 | depends_on "pkg-config" => :build 8 | 9 | depends_on "gettext" 10 | depends_on "glib" 11 | depends_on "json-glib" 12 | depends_on "libarchive" # need >= 3.0.0 13 | depends_on "libsoup" 14 | 15 | def install 16 | args = %W[ 17 | --disable-dependency-tracking 18 | --disable-silent-rules 19 | --prefix=#{prefix} 20 | --localstatedir=#{var} 21 | --sysconfdir=#{etc} 22 | ] 23 | system "./configure", *args 24 | system "make", "install" 25 | end 26 | 27 | test do 28 | system "#{bin}/osinfo-db-path" 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /virt-viewer.rb: -------------------------------------------------------------------------------- 1 | class VirtViewer < Formula 2 | desc "App for virtualized guest interaction" 3 | homepage "https://virt-manager.org/" 4 | url "https://releases.pagure.org/virt-viewer/virt-viewer-8.0.tar.gz" 5 | sha256 "dcf358ed5d7a4900215133135a6492c04311d84332816d930df9a89d6195b6ed" 6 | 7 | depends_on "intltool" => :build 8 | depends_on "libtool" => :build 9 | depends_on "pkg-config" => :build 10 | 11 | depends_on "atk" 12 | depends_on "cairo" 13 | depends_on "gdk-pixbuf" 14 | depends_on "gettext" 15 | depends_on "glib" 16 | depends_on "gtk+3" 17 | depends_on "gtk-vnc" 18 | depends_on "hicolor-icon-theme" 19 | depends_on "libvirt" 20 | depends_on "libvirt-glib" 21 | depends_on "pango" 22 | depends_on "shared-mime-info" 23 | depends_on "spice-gtk" 24 | depends_on "spice-protocol" 25 | depends_on "gobject-introspection" 26 | 27 | def install 28 | args = %W[ 29 | --disable-silent-rules 30 | --disable-update-mimedb 31 | --with-gtk-vnc 32 | --with-spice-gtk 33 | --prefix=#{prefix} 34 | ] 35 | system "./configure", *args 36 | system "make", "install" 37 | end 38 | 39 | def post_install 40 | # manual update of mime database 41 | system "#{Formula["shared-mime-info"].opt_bin}/update-mime-database", "#{HOMEBREW_PREFIX}/share/mime" 42 | # manual icon cache update step 43 | system "#{Formula["gtk+3"].opt_bin}/gtk3-update-icon-cache", "#{HOMEBREW_PREFIX}/share/icons/hicolor" 44 | end 45 | 46 | test do 47 | system "#{bin}/virt-viewer", "--version" 48 | end 49 | end 50 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | homebrew-virt-manager 2 | ===================== 3 | 4 | A set of [homebrew][homebrew] formulae to install [`virt-manager`][virt-manager] and [`virt-viewer`][virt-viewer] on Mac OSX. 5 | 6 | ## Usage 7 | 8 | brew tap Krish-sysadmin/homebrew-virt-manager 9 | brew install virt-manager virt-viewer 10 | virt-manager -c test:///default 11 | 12 | ## FAQs 13 | 14 | #### Why can't I connect to a remote URI? 15 | 16 | When connecting to remote URIs, you probably need to override the `libvirt` socket location, see [www.jedi.be][jedi]. 17 | 18 | virt-manager -c 'qemu+ssh://user@libvirthost/system?socket=/var/run/libvirt/libvirt-sock' 19 | virt-viewer -c 'qemu+ssh://user@libvirthost/system?socket=/var/run/libvirt/libvirt-sock' 20 | 21 | #### I still can't connect to a remote URI, why? 22 | 23 | This formula for `virt-manager` does not include the `openssh-askpass` dependency and does not prompt for passwords in a popup window. Here are two workarounds: 24 | 25 | 1. Run `virt-manager` with either the `--debug` or `--no-fork` option to get password prompt via the CLI. 26 | 27 | 2. Set up SSH keys between your local and remote system to avoid the prompt. 28 | 29 | #### Why can't I connect to a local URI (*e.g.*, qemu:///system)? 30 | 31 | I've not yet tested `virt-manager` against any local URIs/hypervisors. If you get `virt-manager` working with a local hypervisor and needed to take any special steps, feel free to share the details. 32 | 33 | #### Everything was working yesterday, but it's not working today, can you help? 34 | 35 | If `virt-manager` or its dependencies have been upgraded recently (`brew upgrade`), it's possible that a reinstall may fix the issue (see [#39](https://github.com/jeffreywildman/homebrew-virt-manager/issues/39)). 36 | 37 | 38 | #### Why am I getting the error "No GSettings schemas are installed on the system"? 39 | 40 | You must make sure that ``/usr/local/share`` is not missing from XDG_DATA_DIRS. If it is, add it to XDG_DATA_DIRS. You can make sure by running ``echo $XDG_DATA_DIRS`` (better in a new bash, zsh etc. session since if you set that environment variable temporarily it would only fix the issue for that shell session). 41 | 42 | [homebrew]: http://brew.sh/ 43 | [virt-manager]: https://virt-manager.org/ 44 | [virt-viewer]: https://virt-manager.org/ 45 | [jedi]: http://www.jedi.be/blog/2011/09/13/libvirt-fog-provider/#macosx-remote-libvirt-client- 46 | -------------------------------------------------------------------------------- /virt-manager.rb: -------------------------------------------------------------------------------- 1 | class VirtManager < Formula 2 | include Language::Python::Virtualenv 3 | 4 | desc "App for managing virtual machines" 5 | homepage "https://virt-manager.org/" 6 | url "https://virt-manager.org/download/sources/virt-manager/virt-manager-2.2.1.tar.gz" 7 | sha256 "cfd88d66e834513e067b4d3501217e21352fadb673103bacb9e646da9f029a1b" 8 | revision 3 9 | 10 | depends_on "intltool" => :build 11 | depends_on "pkg-config" => :build 12 | 13 | depends_on "adwaita-icon-theme" 14 | depends_on "gtk+3" 15 | depends_on "gtk-vnc" 16 | depends_on "gtksourceview4" 17 | depends_on "hicolor-icon-theme" 18 | depends_on "libosinfo" 19 | depends_on "libvirt" 20 | depends_on "libvirt-glib" 21 | depends_on "libxml2" # need python3 bindings 22 | depends_on "osinfo-db" 23 | depends_on "py3cairo" 24 | depends_on "pygobject3" 25 | depends_on "python" 26 | depends_on "spice-gtk" 27 | depends_on "vte3" 28 | 29 | resource "libvirt-python" do 30 | url "https://libvirt.org/sources/python/libvirt-python-8.1.0.tar.gz" 31 | sha256 "a21ecfab6d29ac1bdd1bfd4aa3ef58447f9f70919aefecd03774613f65914e43" 32 | end 33 | 34 | resource "idna" do 35 | url "https://pypi.io/packages/source/i/idna/idna-2.8.tar.gz" 36 | sha256 "c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407" 37 | end 38 | 39 | resource "certifi" do 40 | url "https://pypi.io/packages/source/c/certifi/certifi-2019.11.28.tar.gz" 41 | sha256 "25b64c7da4cd7479594d035c08c2d809eb4aab3a26e5a990ea98cc450c320f1f" 42 | end 43 | 44 | resource "chardet" do 45 | url "https://pypi.io/packages/source/c/chardet/chardet-3.0.4.tar.gz" 46 | sha256 "84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae" 47 | end 48 | 49 | resource "urllib3" do 50 | url "https://pypi.io/packages/source/u/urllib3/urllib3-1.25.7.tar.gz" 51 | sha256 "f3c5fd51747d450d4dcf6f923c81f78f811aab8205fda64b0aba34a4e48b0745" 52 | end 53 | 54 | resource "requests" do 55 | url "https://pypi.io/packages/source/r/requests/requests-2.22.0.tar.gz" 56 | sha256 "11e007a8a2aa0323f5a921e9e6a2d7e4e67d9877e85773fba9ba6419025cbeb4" 57 | end 58 | 59 | # virt-manager doesn't prompt for password on macOS unless --no-fork flag is provided 60 | patch :DATA 61 | 62 | def install 63 | venv = virtualenv_create(libexec, "python3") 64 | venv.pip_install resources 65 | 66 | # virt-manager uses distutils, doesn't like --single-version-externally-managed 67 | system "#{libexec}/bin/python", "setup.py", 68 | "configure", 69 | "--prefix=#{libexec}" 70 | system "#{libexec}/bin/python", "setup.py", 71 | "--no-user-cfg", 72 | "--no-update-icon-cache", 73 | "--no-compile-schemas", 74 | "install" 75 | 76 | # install virt-manager commands with PATH set to Python virtualenv environment 77 | bin.install Dir[libexec/"bin/virt-*"] 78 | bin.env_script_all_files(libexec/"bin", :PATH => "#{libexec}/bin:$PATH") 79 | 80 | share.install Dir[libexec/"share/man"] 81 | share.install Dir[libexec/"share/glib-2.0"] 82 | share.install Dir[libexec/"share/icons"] 83 | end 84 | 85 | def post_install 86 | # manual schema compile step 87 | system "#{Formula["glib"].opt_bin}/glib-compile-schemas", "#{HOMEBREW_PREFIX}/share/glib-2.0/schemas" 88 | # manual icon cache update step 89 | system "#{Formula["gtk+3"].opt_bin}/gtk3-update-icon-cache", "#{HOMEBREW_PREFIX}/share/icons/hicolor" 90 | end 91 | 92 | test do 93 | system "#{bin}/virt-manager", "--version" 94 | end 95 | end 96 | __END__ 97 | diff --git a/virt-manager b/virt-manager 98 | index 15d5109..8ee305a 100755 99 | --- a/virt-manager 100 | +++ b/virt-manager 101 | @@ -151,7 +151,8 @@ def parse_commandline(): 102 | help="Print debug output to stdout (implies --no-fork)", 103 | default=False) 104 | parser.add_argument("--no-fork", action="store_true", 105 | - help="Don't fork into background on startup") 106 | + help="Don't fork into background on startup", 107 | + default=True) 108 | 109 | parser.add_argument("--show-domain-creator", action="store_true", 110 | help="Show 'New VM' wizard") 111 | --------------------------------------------------------------------------------