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

Issues compiling on Windows #299

Closed
2 of 6 tasks
wzrd96 opened this issue Jan 9, 2024 · 19 comments
Closed
2 of 6 tasks

Issues compiling on Windows #299

wzrd96 opened this issue Jan 9, 2024 · 19 comments
Labels
bug Something isn't working triage This issue requires triaging

Comments

@wzrd96
Copy link

wzrd96 commented Jan 9, 2024

Description:

I've encountered multiple errors while attempting to build the docker.

  1. Originally compiled docker compose against the docker-compose.dev.yml file and it worked, however I was unable to access the bloodhound UI or figure out how to do so. Similar to issue #34
  2. Started over with the suggestions from the (README.md), however this fails with the error filesystem layer verification failed for digest sha256:...
  3. After installing scoop, I was able to install just and tried to run just init within the master folder and received the error error: Could not find cygpath executable to translate recipe init shebang interpreter path: program not found. I installed cygwin and all the necessary requirements to build, however using powershell did not work.
  4. Lastly I attempted to use the Git terminal that was installed, however that failed with the error
4.893 ERROR: unable to select packages:
4.905   p7zip (no such package):
4.905     required by: world[p7zip]

7zip is installed through scoop however it seems to be looking for p7zip which is the linux package.

Component(s) Affected:

  • UI
  • API
  • Neo4j
  • PostgreSQL
  • Data Collector (SharpHound, AzureHound)
  • Other (tooling, documentation, etc.)

Environment Information:

BloodHound: [5.4.0]

OS: [Windows 10]

Browser: [Chrome 120]

Node.js: [21.5]

Docker (if using Docker): [Desktop 4.26.1]

@wzrd96 wzrd96 added bug Something isn't working triage This issue requires triaging labels Jan 9, 2024
@superlinkx
Copy link
Contributor

Are you trying to set up a dev environment? If so, it's highly advised that you use WSL2. Alternatively, you can use VS Code and use the Dev Container setup to get a nice Linux environment for building and testing. Directly using tooling in Windows is not supported for dev or building

@wzrd96
Copy link
Author

wzrd96 commented Jan 10, 2024

No I just wanted to setup the standard environment as per the README on the front page of the repo. For the dev environment if I went that route, I would setup an instance and then install from there?

@superlinkx
Copy link
Contributor

superlinkx commented Jan 10, 2024

If you're just trying to run BloodHound on Windows, you just need Docker Desktop and then copy the docker-compose.yml from the link in the README. Run it with docker compose up and you should be in business.

You do not need to clone the repo to use BloodHound, and the docker-compose.dev.yml is only used for the dev environment, you won't want to use it unless you're setting up a dev environment.

@wzrd96
Copy link
Author

wzrd96 commented Jan 10, 2024

Okay I will try copying just the docker-compose.yml and give my results.

I wasn't clear enough with issue 2 but I will expand. As you mentioned I did clone the repo, first tried docker compose up within the examples directory which resulted in the file digest sha256 error. I then tried to copy that folder and paste it ouside the repo and received the same error. Lastly I copied just the file from the directory and placed it within the repo folder and received the same error.

@superlinkx
Copy link
Contributor

The first way you tried should work too. A file digest error indicates something is going wrong with your docker instance. You could try clearing all its data and try running docker compose up again, or go further and run docker compose build to see if it will build the necessary containers for you. If that doesn't work, a full copy of the log from when you try to docker compose up will make it easier to identify where it's going wrong and what resources to point you at.

@wzrd96
Copy link
Author

wzrd96 commented Jan 11, 2024

I've ran docker system prune -af and then run docker compose up wtihin the folder where the yml file is located and I am still receiving the sha error. I tried running it with verbose to get a better log output but nothing changes. Also I've tried to attach an image but it will not upload so I copied the output directly.

> docker compose --verbose up
[+] Running 30/22
 ✔ app-db 14 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿]      0B/0B      Pulled                                                       67.7s
 - bloodhound 16 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣿⠀⠀⠀⠀] 17.83MB/24.39MB Pulling                                                74.4s
 - graph-db 5 layers [⣿⣿⣿⣿⣦] 86.22MB/120.6MB Pulling                                                              74.4s

filesystem layer verification failed for digest sha256:33d9b7e8b6c14fa8db6b36f555378c9a544d4ba1aa029db1c01ce2d59cafbb3f

@superlinkx
Copy link
Contributor

superlinkx commented Jan 11, 2024

That's extremely odd output. It would have been nice if Docker told us which of the two images it was pulling failed, since it would be easier to chase down. I'll see if I can find a way to replicate it, but this is definitely an internal docker failure of some kind. Only advice I can give at this point is to try upgrading Docker (sorry, should have double checked the version you reported) just entirely reinstalling Docker if you're able. If I can get a successful repro, I'll update this issue

@wzrd96
Copy link
Author

wzrd96 commented Jan 11, 2024

I've seen docker expand the sections before however it decides to minimize them and I can't find a way to keep it expanded. I have gotten it to the point where postgres and neo4j images seem to be loaded but it fails after that. With my instance which may help in replicating the issue, I had the requirement to run the docker install, docker app, and powershell as Administrator. Also I had just tried uninstalling docker and starting from scratch and I still receive the same error.

Edit: I also don't understand how the dev yml ran perfectly fine. Everything worked but there is no UI

@superlinkx
Copy link
Contributor

superlinkx commented Jan 11, 2024

Ok thanks, I'll see if I can repro on my side. The image verification check failing means something is getting corrupted while it's trying to pull the bloodhound image from Docker Hub, which is very odd and very opaque

@superlinkx
Copy link
Contributor

Did a fresh reset on my end, and it pulls fine. I don't think the issue has anything to do with the Docker Hub image, so that leaves something wrong with Docker Desktop. I stopped using Docker Desktop out of frustration a while back and run Docker in WSL2 the normal Linux way. I'll ask around and see what other Windows users on the team are using for a Docker Desktop version, and report back a known working version.

@wzrd96
Copy link
Author

wzrd96 commented Jan 11, 2024

There was the option to use WSL2 as the backend within Docker desktop instead of HyperV. Would you have a guide to setting up Docker in WSL2, if that is not too much to ask.

@wzrd96
Copy link
Author

wzrd96 commented Jan 11, 2024

So I installed the default Ubuntu image within wsl2 and checked the option within Docker Desktop for integration with wsl2. Microsoft Guide
I ran docker compose up from within the wsl box and it gave me the same error, so I just tried running it a second time and it spat out more information this time:

[+] Running 15/23
 ⠸ bloodhound 16 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣿⠀⠀⠀⠀] 23.73MB/24.39MB Pulling                                                44.3s
   ✔ 07a64a71e011 Pull complete                                                                                   19.7s
   ✔ fe5ca62666f0 Pull complete                                                                                   20.3s
   ✔ 280126c0e181 Pull complete                                                                                   22.0s
   ✔ fcb6f6d2c998 Pull complete                                                                                   22.5s
   ✔ e8c73c638ae9 Pull complete                                                                                   22.9s
   ✔ 1e3d9b7d1452 Pull complete                                                                                   23.3s
   ✔ 4aa0ea1413d3 Pull complete                                                                                   23.6s
   ✔ 7c881f9ab25e Pull complete                                                                                   23.9s
   ✔ 5627a970d25e Pull complete                                                                                   24.5s
   ✔ 0a9c14237134 Pull complete                                                                                   25.1s
   ⠏ 5d20fb274d0c Downloading [================================================>  ]  23....                       42.9s
   ✔ 4f4fb700ef54 Download complete                                                                               41.8s
   ⠏ 33d9b7e8b6c1 Verifying Checksum                                                                              42.9s
   ⠏ a5f1231c02b8 Waiting                                                                                         42.9s
   ⠏ 8d62b45a86f0 Waiting                                                                                         42.9s
   ⠏ 60e22cf18af8 Waiting                                                                                         42.9s
 ⠸ graph-db 5 layers [⣿⣿⣿⣿⣤] 75.16MB/120.6MB Pulling                                                              44.3s
   ✔ 0e0969fcaa82 Pull complete                                                                                   19.2s
   ✔ 67b73066ba82 Download complete                                                                               42.0s
   ✔ a9cf38d5eb92 Download complete                                                                                0.4s
   ✔ e0ba10e7ad99 Download complete                                                                                0.8s
   ⠼ ece77c018cf3 Downloading [===============================>                   ]  75....                       43.4s
filesystem layer verification failed for digest sha256:33d9b7e8b6c14fa8db6b36f555378c9a544d4ba1aa029db1c01ce2d59cafbb3f
wslroot:

@superlinkx
Copy link
Contributor

This would be a decent guide for how to set up systemd and docker on WSL2: https://dev.to/klo2k/run-docker-in-wsl2-in-5-minutes-via-systemd-without-docker-desktop-28gi. You'll need to fully remove Docker Desktop (and likely clean up the main WSL2 image since it'll potentially have some files related to docker desktop integration) and then follow the guide to get it working. Can't really help much beyond that on the running Docker front, but I am seeing if I can get a dev with Docker Desktop set up to take a crack at things and we'll report what we find.

@leechristensen
Copy link

leechristensen commented Jan 11, 2024

FWIW, I use Docker Desktop with WSL2 and have never built/run BHCE before. I cloned the repo, changed to the examples/docker-compose directory, and ran docker compose up and things came up just fine.

@superlinkx
Copy link
Contributor

@leechristensen would you mind sharing which Docker Desktop version you're using? I have a feeling it could be a version specific bug, unless you're on the most recent version

@leechristensen
Copy link

leechristensen commented Jan 11, 2024

$ docker version
Client: Docker Engine - Community
 Cloud integration: v1.0.35-desktop+001
 Version:           24.0.5
 API version:       1.43
 Go version:        go1.20.6
 Git commit:        ced0996
 Built:             Fri Jul 21 20:35:45 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Desktop
 Engine:
  Version:          24.0.5
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.6
  Git commit:       a61e2b4
  Built:            Fri Jul 21 20:35:45 2023
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          1.6.21
  GitCommit:        3dce8eb055cbb6872793272b4f20ed16117344f8
 runc:
  Version:          1.1.7
  GitCommit:        v1.1.7-0-g860f061
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

In the Docker Desktop GUI, it says I'm on v4.22.1.

@leechristensen
Copy link

Upgrade Docker Desktop to 4.26.1 (the latest) and also works.

@wzrd96
Copy link
Author

wzrd96 commented Jan 17, 2024

After a lot of struggling with getting WSL2 to work with my VPN I was able to get docker installed and successfully ran docker compose up.

@superlinkx I was having troubles accessing neo4j through the web browser but I think I figured out what the issue with that was, but I haven't been able to test it. What would the command be to run the docker instance again after its been quit? I tried checking docker container ls and docker ps but I do not see any instances that were processed during the compose stage.

@superlinkx
Copy link
Contributor

You can just run docker compose up anytime you want things to run again. Using ctrl+c to exit should do the equivalent of docker compose down but if it seems to just exit early, it might be worth doing a docker compose down anytime you stop just to be sure everything is shutdown cleanly for the next run.

For accessing the Neo4j web interface, you should just need to uncomment the ports lines under the graph-db service in docker-compose.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage This issue requires triaging
Projects
None yet
Development

No branches or pull requests

4 participants