Source .profile on qvm-run call

I am setting up a development qube where I need some different $PATHs set for command execution, I modify my $PATH env variable in .profile in my development qube.
However when I run qvm-run development-qube <command> it tells me the command is missing, providing the absolute path to the command works, so does running the command by itself from a terminal inside of the qube so it seems like this is an issue with qvm-run not running in a shell which sources .profile.

Is there a way to set this up as a default? I could run qvm-run development-qube "source .profile && <command>" everytime but that

  1. does not transfer to using the qube manager to run commands
  2. is tiresome and verbose
  3. does not scale well, in all scripts everywhere I would have to do this

Thanks

add --pass-io option.

Hi!

I’m not exactly sure what you mean, adding --pass-io yields the output that the command does not exist.

as example qvm-run --pass-io development-qube "source .profile && <command>"

Then it works, but like I outlined in the OP it would be really nice if it was possible to exclude the source .profile && part of this and have qvm-run source .profile on default somehow.

So, bash (man bash) and other shells have switches (e.g. --login) that tell them how much interactive user context to invoke. By default very little…but some switches approximate the behavior seen for a user session and would automatically load a profile. Default for non interactive is not to.

If you want that then you’ll need to tell qvm-run to invoke the shell directly, with appropriate flags, to then run a command from that shell. You’ll likely enjoy the fun of multiple quoting levels.

B

I see, in that case it seems like I’d have less trouble just sourcing .profile whenever I need to run a command that requires that.

If there isn’t a better way then I’ll have to live with it. Thanks :slight_smile: