From nobody Fri May 17 08:39:28 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1703170422820440.08720763940266; Thu, 21 Dec 2023 06:53:42 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id BA1601B7C; Thu, 21 Dec 2023 09:53:41 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id AB2871B32; Thu, 21 Dec 2023 09:52:06 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 0DE431B2E; Thu, 21 Dec 2023 09:52:04 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 5C0351B24 for ; Thu, 21 Dec 2023 09:52:03 -0500 (EST) Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-179-1UMudVMbOU6tyMYQnzvUEg-1; Thu, 21 Dec 2023 09:52:01 -0500 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-40d42061a35so1338585e9.0 for ; Thu, 21 Dec 2023 06:52:01 -0800 (PST) Received: from wheatley.localdomain (nat-pool-brq-u.redhat.com. [213.175.37.12]) by smtp.gmail.com with ESMTPSA id h7-20020a05600c350700b0040d2e37c06dsm3544572wmq.20.2023.12.21.06.51.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 06:51:59 -0800 (PST) Received: from wheatley.pinto-pinecone.ts.net (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 1A83917B7D6CB for ; Thu, 21 Dec 2023 15:51:59 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: 1UMudVMbOU6tyMYQnzvUEg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703170320; x=1703775120; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4TVe/yjLBVLL92v68l0Na1WB4ZW3n5k1dVUpFcwHMHw=; b=VXmdnM0CjJB6jjlN7gP5w2L0nBK16/TcD3ZaORpaHn8YdoWsvTyVLAq0LwL8zBL/T1 vX5fKbEfADrDFI/FUuQ0vpWaaENnEIpjx7So+tmOX6yyBYQmVLHul+VJwDEZq8R/3mB9 PBpDHdDldnzStSNtgSz3Y86ef2pO1WS0X1Nefs/uyflIeNCMFyVWfJjkEVAyxjkQZWrN ikcZErKYbuRANzCcFDu82s9HIRqzXh5ZBdIMKbrcYu2qNdrlCCOTESCITMoH3SMrCa0i Osxy0iVqSCmCguGO+mCnP2bfX+Lk8QaZVLaIq1xJcKP7jsoiGzYLiOr0Fi6lgKgAjEkl KQ+w== X-Gm-Message-State: AOJu0YzGDQ5Z0Tb2Sd+qWW7DXxnAh34WtsareHGERbKapEh5pob546n9 ykvgyXfSPXU9BUkogoXpDrFEQ6/PkCRQCc+ycEi727JQCGj4ZMppK8J5huwTU6gEg3wMG8nnmKi yZeeJbQedu8OtNNm6IYvayV0vvMKud1cWVNLzH/8w/FMi+w/OZvuL6mRyLLQsH3/Epodxq4nOK5 JukA== X-Received: by 2002:a05:600c:3509:b0:40d:2c0d:784f with SMTP id h9-20020a05600c350900b0040d2c0d784fmr819500wmq.75.1703170320398; Thu, 21 Dec 2023 06:52:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IEsvisuA6NgOoF7eZqEKkXk2Hoby1VBnS6Jtj5KpmTILQckSelKiSp/rXv/5CCM9sJvZxhF5A== X-Received: by 2002:a05:600c:3509:b0:40d:2c0d:784f with SMTP id h9-20020a05600c350900b0040d2c0d784fmr819493wmq.75.1703170319995; Thu, 21 Dec 2023 06:51:59 -0800 (PST) From: Martin Kletzander To: devel@lists.libvirt.org Subject: [PATCH v2] Improve error message in remoteGetUNIXSocket Date: Thu, 21 Dec 2023 15:48:30 +0100 Message-ID: <06e7c5cfe308de3a132ce33608de62f40ee85965.1703170109.git.mkletzan@redhat.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: 4EI7XFWRK3MRWPK672KL5Q7AVAVRGS3X X-Message-ID-Hash: 4EI7XFWRK3MRWPK672KL5Q7AVAVRGS3X X-MailFrom: mkletzan@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8"; x-default="true" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1703170425039100001 By adding a link to an explanation in the kbase. Signed-off-by: Martin Kletzander Reviewed-by: Richard W.M. Jones --- v2: - Do not print first socket path - Add a kbase article explaining the details and solutions - Add a link to said article v1: https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/WGEV= YM4MEYLEKUGNVOYTOFP66IVLWNGL/ .../kbase/failed_connection_after_install.rst | 58 +++++++++++++++++++ docs/kbase/index.rst | 3 + docs/kbase/meson.build | 1 + src/remote/remote_sockets.c | 2 +- 4 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 docs/kbase/failed_connection_after_install.rst diff --git a/docs/kbase/failed_connection_after_install.rst b/docs/kbase/fa= iled_connection_after_install.rst new file mode 100644 index 000000000000..cea57c460e10 --- /dev/null +++ b/docs/kbase/failed_connection_after_install.rst @@ -0,0 +1,58 @@ +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +Libvirt does not work after installation +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +.. contents:: + +TL;DR +=3D=3D=3D=3D=3D + +Most probably you want to start a virtqemud socket: + +:: + + # systemctl start virtqemud.socket + +If you are unsure whether to do this, please read the rest of this documen= t. + +Symptom +=3D=3D=3D=3D=3D=3D=3D + +After installing libvirt or a virt tool that uses libvirt, commands do +not work when run as root: + +:: + + # virsh list + error: failed to connect to the hypervisor + error: Operation not supported: Cannot use direct socket mode if no URI= is set. + For more information see https://libvirt.org/kbase/failed_connection_af= ter_install.html + +Root cause +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Distribution guidelines and/or configurations may discourage or prohibit +starting services as part of a package installation. And because libvirt = cannot +know where you might want to connect it cannot start it on its own. + +Solution +=3D=3D=3D=3D=3D=3D=3D=3D + +After installing libvirt you may need to start a particular libvirt daemon= on +the local machine, set a (default) URI to connect to or, alternatively, +rebooting the machine might work. + +If you are trying to connect to a remote libvirt daemon you need to specif= y a `connection URI <../uri.html>`__. + +If you are trying to control a local hypervisor, then the solution depends= on various factors. You should know: + +- what hypervisor driver you want to connect to, whether it is ``virtqemud= `` for QEMU, ``virtchd`` for Cloud Hypervisor, etc. and +- how to start a service or socket (in case of systemd) on you system. + +Example of the most common solution, trying to use QEMU/KVM on Linux with = systemd as an init system, is: + +:: + + # systemctl start virtqemud.socket + +also provided on the top of the page. diff --git a/docs/kbase/index.rst b/docs/kbase/index.rst index 896ececdf258..e51b35cbfce5 100644 --- a/docs/kbase/index.rst +++ b/docs/kbase/index.rst @@ -64,6 +64,9 @@ Usage `Secure Boot `__ Enable and disable the Secure Boot feature =20 +`Connection fail after installation = `__ + Explanation of a common issue users stumble upon after installation + =20 Debugging --------- diff --git a/docs/kbase/meson.build b/docs/kbase/meson.build index 5b608293e27c..6d4ca90215a5 100644 --- a/docs/kbase/meson.build +++ b/docs/kbase/meson.build @@ -2,6 +2,7 @@ docs_kbase_files =3D [ 'backing_chains', 'debuglogs', 'domainstatecapture', + 'failed_connection_after_install', 'index', 'kvm-realtime', 'launch_security_sev', diff --git a/src/remote/remote_sockets.c b/src/remote/remote_sockets.c index 4ab3d72933e2..8d403b6f014a 100644 --- a/src/remote/remote_sockets.c +++ b/src/remote/remote_sockets.c @@ -398,7 +398,7 @@ remoteGetUNIXSocket(remoteDriverTransport transport, =20 if (!direct_sock_name) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("Cannot use direct socket mode if no URI is s= et")); + _("Cannot use direct socket mode if no URI is s= et. For more information see https://libvirt.org/kbase/failed_connection_af= ter_install.html")); return NULL; } =20 --=20 2.43.0 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org