-
Notifications
You must be signed in to change notification settings - Fork 78
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
hack: Add remote lldb utilities to hack dir #596
Conversation
This is useful for remote debugging bootc running in a VM. Until podman-bootc has support for forwarding arbitrary ports, this custom solution is needed. Signed-off-by: Chris Kyrouac <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I have never tried using lldb...I'm usually a "printf debugging" person.
@@ -0,0 +1,21 @@ | |||
#!/bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some overlap here with #593 a bit and of course - a lot of overlap with https://github.com/containers/podman-bootc ...I was really thinking about trying to make that a more generic tool, but it gets tricky.
There's so many virtualization wrappers on Linux...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed, eventually podman-bootc should provide everything needed for this, but in the meantime I just wanted to use lldb. The primary (only?) thing preventing using podman-bootc is the networking stuff.
@@ -0,0 +1,2 @@ | |||
net.ipv6.conf.all.disable_ipv6 = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why out of curiosity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a weird issue where the lldb connection was trying to use the ipv6 address and failing, this fixed it. I have ipv6 turned off on my host.
virsh -c qemu:///system destroy bootc-lldb | ||
virsh -c qemu:///system undefine --nvram bootc-lldb | ||
set -e | ||
sudo virt-install --name bootc-lldb --cpu host --vcpus 8 --memory 8192 --import --disk ~/.cache/bootc-dev/disks/lldb.raw --os-variant rhel9-unknown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this one we could use --qemu-commandline
to pass the ssh key via credentials too right? This is probably something to do via a patch to virt-install.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, I was playing around with the now defunct included-ssh-pubkey example and got it working so I just continued using it. Either way works for me.
RUN dnf -y install lldb firewalld vim && \ | ||
firewall-offline-cmd --add-port 1025-65535/tcp && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, interesting that you're adding firewalld here only to poke a lot of holes in the firewall...any reason for that?
(In the near future we may want to actually add firewalld to our base images though)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
firewalld is just really simple to use. I was surprised it's not in the base image. lldb uses the user defined port for the initial connection along with seemingly any random port in the 30000-* range.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can always do fixes here as followups, so fine to me to merge as is.
…-1.0.79 build(deps): bump anyhow from 1.0.78 to 1.0.79
This is useful for remote debugging bootc running in a VM.
Until podman-bootc has support for forwarding arbitrary ports, this custom solution is needed.
This has been working well for me and I thought it might be useful to include in the docs for others to try if they're interested.