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

Biu Sur - the fight goes on without success :( #159

Open
TorinKR opened this issue Nov 26, 2020 · 13 comments
Open

Biu Sur - the fight goes on without success :( #159

TorinKR opened this issue Nov 26, 2020 · 13 comments

Comments

@TorinKR
Copy link

TorinKR commented Nov 26, 2020

In Big Sur, after the update brew, the virt-manager started to launch.
But virt-viewer flies with such errors and locks the whole virt-maneger I fell: /

Invalid operand Traceback (most recent call last): File "/usr/local/Cellar/virt-manager/2.2.1_3/libexec/share/virt-manager/virtManager/manager.py", line 489, in row_activated self.show_vm(_src) File "/usr/local/Cellar/virt-manager/2.2.1_3/libexec/share/virt-manager/virtManager/manager.py", line 474, in show_vm vmmenu.VMActionUI.show(self, self.current_vm()) File "/usr/local/Cellar/virt-manager/2.2.1_3/libexec/share/virt-manager/virtManager/vmmenu.py", line 330, in show vmmVMWindow.get_instance(src, vm).show() AttributeError: 'NoneType' object has no attribute 'show' zsh: segmentation fault virt-manager

anyone have any idea?

Torin

@timscha
Copy link

timscha commented Dec 4, 2020

Can confirm, Big Sur isn't working anymore. I got the following error, when I tried a clean install:

Last 15 lines from /Users/tim/Library/Logs/Homebrew/virt-manager/07.pip:
  Found link https://files.pythonhosted.org/packages/73/8e/7774190ac616c69194688ffce7c1b2a097749792fea42e390e7ddfdef8bc/pip-20.2.2.tar.gz#sha256=58a3b0b55ee2278104165c7ee7bc8e2db6f635067f3c66cf637113ec5aa71584 (from https://pypi.org/simple/pip/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*), version: 20.2.2
  Found link https://files.pythonhosted.org/packages/4e/5f/528232275f6509b1fff703c9280e58951a81abe24640905de621c9f81839/pip-20.2.3-py2.py3-none-any.whl#sha256=0f35d63b7245205f4060efe1982f5ea2196aa6e5b26c07669adcf800e2542026 (from https://pypi.org/simple/pip/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*), version: 20.2.3
  Found link https://files.pythonhosted.org/packages/59/64/4718738ffbc22d98b5223dbd6c5bb87c476d83a4c71719402935170064c7/pip-20.2.3.tar.gz#sha256=30c70b6179711a7c4cf76da89e8a0f5282279dfb0278bec7b94134be92543b6d (from https://pypi.org/simple/pip/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*), version: 20.2.3
  Found link https://files.pythonhosted.org/packages/cb/28/91f26bd088ce8e22169032100d4260614fc3da435025ff389ef1d396a433/pip-20.2.4-py2.py3-none-any.whl#sha256=51f1c7514530bd5c145d8f13ed936ad6b8bfcb8cf74e10403d0890bc986f0033 (from https://pypi.org/simple/pip/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*), version: 20.2.4
  Found link https://files.pythonhosted.org/packages/0b/f5/be8e741434a4bf4ce5dbc235aa28ed0666178ea8986ddc10d035023744e6/pip-20.2.4.tar.gz#sha256=85c99a857ea0fb0aedf23833d9be5c40cf253fe24443f0829c7b472e23c364a1 (from https://pypi.org/simple/pip/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*), version: 20.2.4
  Found link https://files.pythonhosted.org/packages/fb/46/26d13ba147ba430f9cda0d0cf599a041d142a5c8b1a90ff845ebce7fba0f/pip-20.3b1-py2.py3-none-any.whl#sha256=122fcd82deac1153c1699f29815bfab3f876e5bbe018cc2df1297f9802572a97 (from https://pypi.org/simple/pip/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*), version: 20.3b1
  Found link https://files.pythonhosted.org/packages/7f/61/2da3c027ad7bd4bc87a3ee7e7160c93e7500dac3536e02ff93008e9b3460/pip-20.3b1.tar.gz#sha256=819c710a5c8d8c5e44695d03e51cb23b08c070e1ae6a5d6910a89e248e0ff29c (from https://pypi.org/simple/pip/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*), version: 20.3b1
  Found link https://files.pythonhosted.org/packages/55/73/bce122d1ed0217b3c1a3439ab16dfa94bbeabd0d31755fcf907493abf39b/pip-20.3-py2.py3-none-any.whl#sha256=3236fe7288d155c238bb6c85d3e784db3a8e592e827b83fea4d36d8b749ecc4b (from https://pypi.org/simple/pip/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*), version: 20.3
  Found link https://files.pythonhosted.org/packages/03/41/6da553f689d530bc2c337d2c496a40dc9c0fdc6481e5df1f3ee3b8574479/pip-20.3.tar.gz#sha256=9ae7ca6656eac22d2a9b49d024fc24e00f68f4c4d4db673d2d9b525c3dea6e0e (from https://pypi.org/simple/pip/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*), version: 20.3
  Found link https://files.pythonhosted.org/packages/ab/11/2dc62c5263d9eb322f2f028f7b56cd9d096bb8988fcf82d65fa2e4057afe/pip-20.3.1-py2.py3-none-any.whl#sha256=425e79b20939abbffa7633a91151a882aedc77564d9313e3584eb0416c28c558 (from https://pypi.org/simple/pip/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*), version: 20.3.1
  Found link https://files.pythonhosted.org/packages/cb/5f/ae1eb8bda1cde4952bd12e468ab8a254c345a0189402bf1421457577f4f3/pip-20.3.1.tar.gz#sha256=43f7d3811f05db95809d39515a5111dd05994965d870178a4fe10d5482f9d2e2 (from https://pypi.org/simple/pip/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*), version: 20.3.1
Given no hashes to check 153 links for project 'pip': discarding no candidates
WARNING: You are using pip version 20.2.4; however, version 20.3.1 is available.
You should consider upgrading via the '/usr/local/Cellar/virt-manager/2.2.1_3/libexec/bin/python -m pip install --upgrade pip' command.
Removed build tracker: '/private/tmp/pip-req-tracker-s01jva0c'

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
  https://github.com/jeffreywildman/homebrew-virt-manager/issues

These open issues may also help:
Error installing virt-manager https://github.com/jeffreywildman/homebrew-virt-manager/issues/145
osx virt-manager console screen is black https://github.com/jeffreywildman/homebrew-virt-manager/issues/113
virt-manager crashing with Python quit unexpectedly while using the libgdk-3.0.dylib https://github.com/jeffreywildman/homebrew-virt-manager/issues/62

@theranger
Copy link
Contributor

Might be related to the issue and solution in #142

@timscha
Copy link

timscha commented Dec 6, 2020

@theranger Thank you! That fixed the install problem. Now Python 3/Virt-Manager crashes when I do a right click.

@AntonioMeireles
Copy link

Hi all,

FWIW got some success (on Big Sur / 11.1) by basically updated everything to current versions. just check here. YMMV

All the best

António

@pahansen95
Copy link

pahansen95 commented Jan 3, 2021

Hi all,

FWIW got some success (on Big Sur / 11.1) by basically updated everything to current versions. just check here. YMMV

All the best

António

Confirming this worked for me on my M1 MacBook Air; thanks!

brew tap AntonioMeireles/homebrew-virt-manager
arch -x86_64 brew install virt-manager virt-viewer

@m-bers
Copy link

m-bers commented Jan 10, 2021

Hi all,
FWIW got some success (on Big Sur / 11.1) by basically updated everything to current versions. just check here. YMMV
All the best
António

Confirming this worked for me on my M1 MacBook Air; thanks!

brew tap AntonioMeireles/homebrew-virt-manager
arch -x86_64 brew install virt-manager virt-viewer

I'm also on M1 MacBook Air, and virt-manager itself is working per your instructions (thank you!), and I made a working formula for qemu (heavily influenced by this) which installs via

brew install --HEAD m-bers/core/qemu
codesign --entitlements /tmp/entitlements.plist --force -s - /opt/homebrew/bin/qemu-system-aarch64
rm /tmp/entitlements.plist

However, I cannot get virt-manager (or virsh) to connect to qemu:///system

Screen Shot 2021-01-09 at 8 56 57 PM

% virsh -c qemu:///system
error: failed to connect to the hypervisor
error: Failed to connect socket to '/usr/local/var/run/libvirt/libvirt-sock': No such file or directory

Anyone else have luck with this? Is is strictly necessary for libvirt and qemu to be compiled for the same architecture? I did try building libvirt for aarch64 with brew install --build-from-source libvirt, but it fails with

==> meson compile
Last 15 lines from /Users/josh/Library/Logs/Homebrew/libvirt/02.meson:
../src/cpu/cpu_arm.c:28:11: fatal error: 'sys/auxv.h' file not found
# include <sys/auxv.h>
          ^~~~~~~~~~~~
1 error generated.

@arthurk
Copy link

arthurk commented Jan 11, 2021

@m-bers The connection to system didn't work for me either, I had to use session:
virt-manager -c "qemu:///session"

@m-bers
Copy link

m-bers commented Jan 11, 2021

@arthurk are you on a Mac with the M1 chip? I'm still not able to connect even via qemu:///session
Screen Shot 2021-01-11 at 6 18 02 AM
Screen Shot 2021-01-11 at 6 18 29 AM

@pahansen95
Copy link

pahansen95 commented Jan 11, 2021

@m-bers My hosts are running on a remote linux machine which needs the libvirt package installed & the libvirtd daemon running as virt-manager connects to a unix socket. Spitballing here but can you install libvirt on your Mac & get a daemon running?

Here's the Libvirt Documentation to the connection URIs

Here is my Connection URI for my remote host

qemu+ssh://user@remote-host:22/system?keyfile=~/.ssh/virt-manager;socket=/var/run/libvirt/libvirt-sock

@arthurk
Copy link

arthurk commented Jan 12, 2021

@m-bers I'm not on the M1, I guess it will be related to that. Quick google showed that qemu has problems running on the M1, I found some info on https://gist.github.com/niw/e4313b9c14e968764a52375da41b4278#running-ubuntu-server-for-arm64 with possible fixes

I've updated the formula with the latest virt-manager (from 2.2 to 3.2) because it had problems with Python 3.9. I've also merged @AntonioMeireles commit that updates all other deps

https://github.com/arthurk/homebrew-virt-manager

brew tap arthurk/homebrew-virt-manager
brew install virt-manager virt-viewer

Only thing I didn't know how to fix is the patch that sets --no-fork default to true: https://github.com/jeffreywildman/homebrew-virt-manager/blob/master/virt-manager.rb#L97 (the changes are the same, it has just moved to a different file). Result is that qemu bin will keep running in the background when virt-manager is closed and needs to be killed manually. Not sure if we should patch it and change default behaviour in the first place.

Workaround is to use --no-fork when starting virt-manager e.g. virt-manager -c "qemu:///session" --no-fork

@m-bers
Copy link

m-bers commented Jan 12, 2021

@pahansen95 Yep, libvirtd is running, and qemu-system-aarch64 is in my path (and works without a hitch by itself)

josh@Joshs-Air ~ % ps aux | grep libvirtd
josh               482   0.0  0.1  8618828  22624   ??  S     8:28AM   0:00.87 /usr/local/Cellar/libvirt/6.10.0/sbin/libvirtd -f /usr/local/etc/libvirt/libvirtd.conf

My guess is that libvirt has to be compiled for the architecture it targets, but sys/auxv.h doesn't exist within the libc that ships with Darwin. I had hoped that since libvirt uses qemu commands under the hood, it would recognize the qemu-system-aarch64 binary that does successfully compile and run on M1 Macs.

The only clue I've found that might suggest a path forward for libvirt (and by extension virt-manager) natively on the M1 chip is this thread regarding building Firefox from source on FreeBSD aarch64, where both read_cpu_features and elf_aux_info functions are discussed as ways to query for CPU features on arm64 chips. I don't see references to either of those functions in Apple's public documentation, and I'm not sure the consequences of getting rid of all references to auxv.h and the function getauxval in libvirt's source code, if it'd even compile at all.

@m-bers
Copy link

m-bers commented Jan 12, 2021

Update, I got libvirt's compilation to go further by applying this patch which I adapted from this libvirt patch for openbsd.

Now the compilation is hanging on virfilewrapper.c with the following output:

[295/810] Compiling C object tests/libtest_file_wrapper.a.p/virfilewrapper.c.o
FAILED: tests/libtest_file_wrapper.a.p/virfilewrapper.c.o 
clang -Itests/libtest_file_wrapper.a.p -Itests -I../tests -Isrc/conf -I../src/conf -Isrc/hypervisor -I../src/hypervisor -Iinclude -I../include -Isrc -I../src -I. -I.. -Isrc/util -I../src/util -Isrc/rpc -I../src/rpc -I/opt/homebrew/Cellar/pcre/8.44/include -I/opt/homebrew/Cellar/glib/2.66.4_1/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.66.4_1/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/libffi/3.3_1/include -I/opt/homebrew/Cellar/glib/2.66.4_1/include -I/opt/homebrew/Cellar/glib/2.66.4_1/include/gio-unix-2.0 -I/opt/homebrew/Cellar/libidn2/2.3.0/include -I/opt/homebrew/Cellar/libtasn1/4.16.0/include -I/opt/homebrew/Cellar/nettle/3.7/include -I/opt/homebrew/Cellar/p11-kit/0.23.22/include/p11-kit-1 -I/opt/homebrew/Cellar/gnutls/3.6.15/include -I/opt/homebrew/Cellar/yajl/2.1.0/include/yajl -Xclang -fcolor-diagnostics -pipe -Wall -Winvalid-pch -Wextra -std=gnu99 -O3 -Werror -fno-common -W -Wabsolute-value -Waddress -Waddress-of-packed-member -Wall -Wattributes -Wbool-operation -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wcomment -Wcomments -Wcpp -Wdangling-else -Wdate-time -Wdeclaration-after-statement -Wdeprecated-declarations -Wdiv-by-zero -Wduplicate-decl-specifier -Wempty-body -Wendif-labels -Wexpansion-to-defined -Wextra -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wformat-zero-length -Wignored-attributes -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wincompatible-pointer-types -Winit-self -Winline -Wint-conversion -Wint-in-bool-context -Wint-to-pointer-cast -Winvalid-pch -Wlogical-not-parentheses -Wmain -Wmemset-transposed-args -Wmisleading-indentation -Wmissing-braces -Wmissing-declarations -Wmissing-field-initializers -Wmissing-include-dirs -Wmissing-prototypes -Wmultichar -Wnarrowing -Wnested-externs -Wnonnull -Wnull-dereference -Wodr -Wold-style-definition -Woverflow -Woverride-init -Wparentheses -Wpointer-arith -Wpointer-compare -Wpointer-sign -Wpointer-to-int-cast -Wpragmas -Wreturn-type -Wsequence-point -Wshadow -Wshift-count-negative -Wshift-count-overflow -Wshift-negative-value -Wsizeof-array-argument -Wsizeof-pointer-div -Wsizeof-pointer-memaccess -Wstrict-aliasing -Wstrict-prototypes -Wswitch -Wswitch-bool -Wtautological-compare -Wtrigraphs -Wtype-limits -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-local-typedefs -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvarargs -Wvariadic-macros -Wvla -Wvolatile-register-var -Wwrite-strings -Wno-sign-compare -Wno-typedef-redefinition -Wswitch-enum -Wno-format-nonliteral -Wframe-larger-than=4096 -fexceptions -fasynchronous-unwind-tables -Wdouble-promotion -Wno-unused-function '-Dabs_builddir="/private/tmp/libvirt-20210111-47165-z13fd/build/tests"' '-Dabs_top_builddir="/private/tmp/libvirt-20210111-47165-z13fd/build"' '-Dabs_srcdir="/private/tmp/libvirt-20210111-47165-z13fd/tests"' '-Dabs_top_srcdir="/private/tmp/libvirt-20210111-47165-z13fd"' -Wframe-larger-than=262144 -MD -MQ tests/libtest_file_wrapper.a.p/virfilewrapper.c.o -MF tests/libtest_file_wrapper.a.p/virfilewrapper.c.o.d -o tests/libtest_file_wrapper.a.p/virfilewrapper.c.o -c ../tests/virfilewrapper.c
In file included from ../tests/virfilewrapper.c:118:
../tests/virmockstathelpers.c:118:52: error: declaration of 'struct stat64' will not be visible outside of this function [-Werror,-Wvisibility]
static int (*real_stat64)(const char *path, struct stat64 *sb);
                                                   ^
../tests/virmockstathelpers.c:130:53: error: declaration of 'struct stat64' will not be visible outside of this function [-Werror,-Wvisibility]
static int (*real_lstat64)(const char *path, struct stat64 *sb);
                                                    ^
../tests/virmockstathelpers.c:229:37: error: declaration of 'struct stat64' will not be visible outside of this function [-Werror,-Wvisibility]
int stat64(const char *path, struct stat64 *sb)
                                    ^
../tests/virmockstathelpers.c:241:50: error: incompatible pointer types passing 'struct stat64 *' to parameter of type 'struct stat64 *' [-Werror,-Wincompatible-pointer-types]
    return real_stat64(newpath ? newpath : path, sb);
                                                 ^~
../tests/virmockstathelpers.c:229:5: error: no previous prototype for function 'stat64' [-Werror,-Wmissing-prototypes]
int stat64(const char *path, struct stat64 *sb)
    ^
../tests/virmockstathelpers.c:229:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int stat64(const char *path, struct stat64 *sb)
^
static 
../tests/virmockstathelpers.c:306:34: error: declaration of 'struct stat64' will not be visible outside of this function [-Werror,-Wvisibility]
lstat64(const char *path, struct stat64 *sb)
                                 ^
../tests/virmockstathelpers.c:318:51: error: incompatible pointer types passing 'struct stat64 *' to parameter of type 'struct stat64 *' [-Werror,-Wincompatible-pointer-types]
    return real_lstat64(newpath ? newpath : path, sb);
                                                  ^~
../tests/virmockstathelpers.c:306:1: error: no previous prototype for function 'lstat64' [-Werror,-Wmissing-prototypes]
lstat64(const char *path, struct stat64 *sb)
^
../tests/virmockstathelpers.c:305:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int
^
static 
8 errors generated.

@m-bers
Copy link

m-bers commented Jan 12, 2021

Submitted my patch to homebrew/homebrew-core on this PR. This isn't directly related to virt-manager on Big Sur specifically (though successful compilation of libvirt on the Apple M1 is required for virt-manager to work properly). I will continue working through this on the PR instead of here

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

7 participants