Starting point: included - fail to build alphine

Hi all,

When I step-by-step went thru the starting point “included” walkthrough I failed to build the alpine image with the following error. I googled a while and found someone said that this is related to rotating keys. I tried to use "udo $HOME/go/bin/distrobuilder build-lxd alpine.yaml -o image.release=3.8 -o source.same_as=3.16 " but no help.

Do you have any idea on this? Thanks in advance.

Regards,
Godchild.

ERROR: unable to select packages:
doas (no such package):
required by: world[doas]
Error: Failed to manage packages: Failed to install packages: exit status 1
ERROR [2023-05-20T05:06:18-04:00] Failed running distrobuilder err=“Failed to manage packages: Failed to install packages: exit status 1”
INFO [2023-05-20T05:06:18-04:00] Removing cache directory

maybe try to verify the availability of doas package.

apt search doas

Hello Marek33366,

I tried. Yes, doas has been installed in my machine. After a few trial-and-error. I successfully built alpine container by “sudo $HOME/go/bin/distrobuilder build-lxd alpine.yaml -o image.release=3.8 -o source.same_as=3.12”

Thanks for your help anyway.

Best regards,
Godchild.

1 Like

Hi godchild,

Try using following command. This will work for you.

sudo $HOME/go/bin/distrobuilder build-lxd alpine.yaml -o image.release=3.9
8 Likes

thanks, works fine

I can’t get the image to build no matter what I do. I got it to build for my architecture (AARCH64) but unfortunately it didn’t run on the target machine. So I changed the architecture to ‘x86_64’ and now I’m getting the following error no matter what version I try to build.

Error: Failed to manage packages: Failed to refresh: fork/exec /sbin/apk: no such file or directory
ERROR [2023-07-31T01:49:45-04:00] Failed running distrobuilder err=“Failed to manage packages: Failed to refresh: fork/exec /sbin/apk: no such file or directory”

I was hoping I could complete all the challenges on this laptop. Can anyone help?

Bump.

This works - I had been stuck on this box for months. This fix works. Kudos to you!! Thank you!

1 Like

If I had to make a suggestion, I would tell you to download a fresh VM image and follow the write up to a tee (With the exception that you do what 1nf3rn0s posted above you.)

I had issues for months. Fresh install was crashing at “doas”, but his command with release updated fixed the problem completely.

thank you for this!

thanks bro it still works at 10.09.2023

Version bump was the answer. Thanks.

Having a slightly different issue when trying to build alpine:

└──╼ [★]$ make
gofmt -s -w .
go install -v ./...
github.com/fsouza/go-dockerclient
# github.com/fsouza/go-dockerclient
../go/pkg/mod/github.com/fsouza/go-dockerclient@v1.9.8/client.go:514:18: undefined: context.Cause
note: module requires Go 1.20
make: *** [Makefile:9: default] Error 2

I’ve tried installing Go 1.20.2, but then the make script chokes because it wants 1.19. Does anyone have a way to deal with this?

This too was broken. I couldn’t get distrobuilder to build because of the Go version.

I then tried using the snap install, which worked, but then I got this error:

Error: Failed to get definition: yaml: unmarshal errors:
line 190: field incus not found in type shared.DefinitionTarget

I ended up completing it by using Method 2 on HackTricks

Yep I am getting this same problem no matter which image-release version I try to build.
Will look into the other hacktricks method. thanks.

Error: Failed to get definition: yaml: unmarshal errors:
line 190: field incus not found in type shared.DefinitionTarget

It seems to me that the tier2 walkthroughs are a bit broken though. There is also a question asked in the Included challenge about what folder tftp stores its files in and I am pretty sure I am answering that correctly but it refuses to accept it /var/lib/tftpboot

Edit out all the incus bits out of the downloaded alpine.yaml, then distrobuilder will build it successfully.

└──╼ [★]$ diff alpine.yaml alpine-fixed.yaml 
190,192d189
<   incus:
<     vm:
<       filesystem: ext4
202,205d198
<   types:
<   - vm
< 
< - generator: incus-agent

Edit: @Alturis add the trailing slash and it will take /var/lib/tftpboot/

Thanks @malx. Actually, I was able to build the alpine image following a different hacktricks set of instructions and a different install sequence. Got that one solved now. Stlll stuck on a few others in the Starting Point Tier 2 group that seems like they might be broken. But will keep at it.

AH! Just saw this. thanks!