Build cook Run, Can we package the project on a VM that has no graphics card?

Hello All
I am setting up automation to test our unreal games on a jenkins machine. I am trying to build cook and run to build and package the project. I am not planning on deploying or launching on the jenkins machine which is a VM. This obviously does not have a graphics card. Can I still successfully build cook run on that machine? I am getting some errors like the game module “My demo project” cannot be found error.

Adding more information to the question above. I am able to package the project with buildcookrun command. But before that, I had to build the game in Visual studio solution. Is there any way we can avoid that. I am doing automation to just download the game from repo and package using BuildCookRun . Thanks in advance.,