Re: qemu+ssh connections to a remote libvirt fail as ssh banner configured

2022-02-10 Thread Jiri Denemark
On Thu, Feb 10, 2022 at 17:47:43 +0800, Yalan Zhang wrote:
> Thank you! I tried /etc/motd, and it does not impact the libvirt connection.
> Happy to learn something new!

Alternatively if you really need to run commands in .bashrc which can
potentially print some output, you can put them after a check for
interactive shell:

if [[ $- != *i* ]] ; then
# Shell is non-interactive.  Be done now!
return
fi

echo "Interactive shell here. How are you?"

Jirka



Re: qemu+ssh connections to a remote libvirt fail as ssh banner configured

2022-02-10 Thread Yalan Zhang
Thank you! I tried /etc/motd, and it does not impact the libvirt connection.
Happy to learn something new!

On Thu, Feb 10, 2022 at 4:50 PM Daniel P. Berrangé 
wrote:

> On Thu, Feb 10, 2022 at 09:33:38AM +0100, Michal Prívozník wrote:
> > On 2/10/22 09:02, Daniel P. Berrangé wrote:
> > > On Thu, Feb 10, 2022 at 09:52:52AM +0800, Yalan Zhang wrote:
> > >> Hi there,
> > >>
> > >> I have a system configured with ssh login banner like as below:
> > >> # cat ~/.bashrc
> > >> ...
> > >> echo
> > >>
> "="
> > >> echo "== This machine is occupied by xxx for testing now. If you
> are
> > >> about to use it, contact xxx first =="
> > >> echo
> > >>
> "="
> > >>
> > >> It works as expected that whenever someone logs into this system by
> ssh,
> > >> he/she will see this warning message.
> > >> But it seems such settings will impact a virsh client connection with
> ssh,
> > >> when I try to connect the libvirt daemon on this system, it will
> error out :
> > >> # virsh -c qemu+ssh://${my_host}/system list --all
> > >> root@${my_host}'s password:
> > >> error: failed to connect to the hypervisor
> > >> error: packet 1027423545 bytes received from server too large, want
> 33554432
> > >
> > > Libvirt is tunnelling an RPC protocol over the SSH connection.
> > > Your bashrc is printing this text onto the SSH conmnection and
> > > that corrupts the libvirt RPC protocol.
> > >
> > > If you want to print something whjen people login use the
> > > /etc/motd file which is designed for this pupose, don't
> > > print stuff from a .bashrc.  Libvirt gives the options to
> > > SSH that prevent display of /etc/motd contents, so that
> > > its RPC protocol doesn't get corrupted.
> >
> > One more thing, I wasn't able to reproduce when virt-ssh-helper was
> > used. But maybe I wasn't trying hard enough.
>
> That should be affected in exactly the same way. It still relies on
> stdout/stdin being clean data channels.
>
> Regards,
> Daniel
> --
> |: https://berrange.com  -o-
> https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org -o-
> https://fstop138.berrange.com :|
> |: https://entangle-photo.org-o-
> https://www.instagram.com/dberrange :|
>
>


Re: qemu+ssh connections to a remote libvirt fail as ssh banner configured

2022-02-10 Thread Daniel P . Berrangé
On Thu, Feb 10, 2022 at 09:33:38AM +0100, Michal Prívozník wrote:
> On 2/10/22 09:02, Daniel P. Berrangé wrote:
> > On Thu, Feb 10, 2022 at 09:52:52AM +0800, Yalan Zhang wrote:
> >> Hi there,
> >>
> >> I have a system configured with ssh login banner like as below:
> >> # cat ~/.bashrc
> >> ...
> >> echo
> >> "="
> >> echo "== This machine is occupied by xxx for testing now. If you are
> >> about to use it, contact xxx first =="
> >> echo
> >> "="
> >>
> >> It works as expected that whenever someone logs into this system by ssh,
> >> he/she will see this warning message.
> >> But it seems such settings will impact a virsh client connection with ssh,
> >> when I try to connect the libvirt daemon on this system, it will error out 
> >> :
> >> # virsh -c qemu+ssh://${my_host}/system list --all
> >> root@${my_host}'s password:
> >> error: failed to connect to the hypervisor
> >> error: packet 1027423545 bytes received from server too large, want 
> >> 33554432
> > 
> > Libvirt is tunnelling an RPC protocol over the SSH connection.
> > Your bashrc is printing this text onto the SSH conmnection and
> > that corrupts the libvirt RPC protocol.
> > 
> > If you want to print something whjen people login use the
> > /etc/motd file which is designed for this pupose, don't
> > print stuff from a .bashrc.  Libvirt gives the options to
> > SSH that prevent display of /etc/motd contents, so that
> > its RPC protocol doesn't get corrupted.
> 
> One more thing, I wasn't able to reproduce when virt-ssh-helper was
> used. But maybe I wasn't trying hard enough.

That should be affected in exactly the same way. It still relies on
stdout/stdin being clean data channels.

Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|



Re: qemu+ssh connections to a remote libvirt fail as ssh banner configured

2022-02-10 Thread Michal Prívozník
On 2/10/22 09:02, Daniel P. Berrangé wrote:
> On Thu, Feb 10, 2022 at 09:52:52AM +0800, Yalan Zhang wrote:
>> Hi there,
>>
>> I have a system configured with ssh login banner like as below:
>> # cat ~/.bashrc
>> ...
>> echo
>> "="
>> echo "== This machine is occupied by xxx for testing now. If you are
>> about to use it, contact xxx first =="
>> echo
>> "="
>>
>> It works as expected that whenever someone logs into this system by ssh,
>> he/she will see this warning message.
>> But it seems such settings will impact a virsh client connection with ssh,
>> when I try to connect the libvirt daemon on this system, it will error out :
>> # virsh -c qemu+ssh://${my_host}/system list --all
>> root@${my_host}'s password:
>> error: failed to connect to the hypervisor
>> error: packet 1027423545 bytes received from server too large, want 33554432
> 
> Libvirt is tunnelling an RPC protocol over the SSH connection.
> Your bashrc is printing this text onto the SSH conmnection and
> that corrupts the libvirt RPC protocol.
> 
> If you want to print something whjen people login use the
> /etc/motd file which is designed for this pupose, don't
> print stuff from a .bashrc.  Libvirt gives the options to
> SSH that prevent display of /etc/motd contents, so that
> its RPC protocol doesn't get corrupted.

One more thing, I wasn't able to reproduce when virt-ssh-helper was
used. But maybe I wasn't trying hard enough.

Michal



Re: libvirtd daemon missing in LFS

2022-02-10 Thread Peter Krempa
On Thu, Feb 10, 2022 at 11:39:17 +0530, Sai Kiran Kumar Reddy wrote:
> Hi,
> 
> There was some issue with pkg-config-path. I have fixed it. I see that it
> looks for wireshark and other dependencies. I get an error saying "remote
> driver is required for libvirtd daemon". I am not sure what this error

So you are missing some of the dependencies needed by the remote driver
which is needed for the libvirtd daemon. Similarly to what I've
suggested before can be used for any other option.

To list full configuration of the project along with options that were
selected you can run 'meson configure' from the builddir and it will
print all options:

$ meson configure

[... snipped ... ]

  Project optionsCurrent ValuePossible Values   
   Description
  -------   
   ---
  apparmor   auto [enabled, disabled, 
auto]apparmor support
  apparmor_profiles  auto [enabled, disabled, 
auto]install apparmor profiles
  attr   auto [enabled, disabled, 
auto]attr support
  audit  auto [enabled, disabled, 
auto]audit support
  bash_completionauto [enabled, disabled, 
auto]bash-completion support
  bash_completion_dir   
   directory containing bash completion scripts
  blkid  auto [enabled, disabled, 
auto]blkid support
  capng  auto [enabled, disabled, 
auto]cap-ng support
  ch_group  
   groupname to run Cloud-Hypervisor system instance as
  ch_user   
   username to run Cloud-Hypervisor system instance as
  chrdev_lock_files 
   location for UUCP style lock files for character devices

   (leave empty for default paths on some platforms)
  curl   auto [enabled, disabled, 
auto]curl support
  docdir
   documentation installation directory
  docs   auto [enabled, disabled, 
auto]whether to generate documentation
  driver_bhyve   auto [enabled, disabled, 
auto]bhyve driver
  driver_ch  auto [enabled, disabled, 
auto]Cloud-Hypervisor driver
  driver_esx auto [enabled, disabled, 
auto]esx driver
  driver_hyperv  auto [enabled, disabled, 
auto]Hyper-V driver
  driver_interface   auto [enabled, disabled, 
auto]host interface driver
  driver_libvirtdauto [enabled, disabled, 
auto]libvirtd driver
  driver_libxl   auto [enabled, disabled, 
auto]libxenlight driver
  driver_lxc auto [enabled, disabled, 
auto]Linux Container driver
  driver_network auto [enabled, disabled, 
auto]virtual network driver
  driver_openvz  auto [enabled, disabled, 
auto]OpenVZ driver
  driver_qemuauto [enabled, disabled, 
auto]QEMU/KVM driver
  driver_remote  auto [enabled, disabled, 
auto]remote driver
  driver_secrets auto [enabled, disabled, 
auto]local secrets management driver
  driver_testauto [enabled, disabled, 
auto]test driver
  driver_vboxauto [enabled, disabled, 
auto]VirtualBox XPCOMC driver
  driver_vmware  auto [enabled, disabled, 
auto]VMware driver
  driver_vz  auto [enabled, disabled, 
auto]Virtuozzo driver
  dtrace auto [enabled, disabled, 
auto]use dtrace for static probing
  expensive_testsauto [enabled, disabled, 
auto]set the default for enabling expensive tests (long

[...]


> means. Does it mean that I have to install wireshark or is it looking for

No wireshark is optional, only if you want to build the dissector for
the libvirt protocol as plugin into wireshark.

> something else. Could you please help me out here.

So 

Re: qemu+ssh connections to a remote libvirt fail as ssh banner configured

2022-02-10 Thread Daniel P . Berrangé
On Thu, Feb 10, 2022 at 09:52:52AM +0800, Yalan Zhang wrote:
> Hi there,
> 
> I have a system configured with ssh login banner like as below:
> # cat ~/.bashrc
> ...
> echo
> "="
> echo "== This machine is occupied by xxx for testing now. If you are
> about to use it, contact xxx first =="
> echo
> "="
> 
> It works as expected that whenever someone logs into this system by ssh,
> he/she will see this warning message.
> But it seems such settings will impact a virsh client connection with ssh,
> when I try to connect the libvirt daemon on this system, it will error out :
> # virsh -c qemu+ssh://${my_host}/system list --all
> root@${my_host}'s password:
> error: failed to connect to the hypervisor
> error: packet 1027423545 bytes received from server too large, want 33554432

Libvirt is tunnelling an RPC protocol over the SSH connection.
Your bashrc is printing this text onto the SSH conmnection and
that corrupts the libvirt RPC protocol.

If you want to print something whjen people login use the
/etc/motd file which is designed for this pupose, don't
print stuff from a .bashrc.  Libvirt gives the options to
SSH that prevent display of /etc/motd contents, so that
its RPC protocol doesn't get corrupted.

Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|