How to fix Vagrant error: `private_key_path` file must exist:
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I've been using PuPHPet to create virtual development environments.
Yesterday I generated a config file for a new box. When I try to spin it up using the vagrant up
command, I get the following error message:
C:xx>vagrant up
Bringing machine 'default' up with 'virtualbox'
provider... There are errors in the configuration of this machine.
Please fix the following errors and try again:
SSH:
*private_key_path
file must exist: P://.vagrant.d/insecure_private_key
I came across this question and moved the insecure_private_key from puphpetfilesdotssh to the same directory as where the Vagrantfile is. However this gives the same error.
I'm also confused by the directory given in the error message;
P://.vagrant.d/insecure_private_key
Why is the 'P' drive mentioned?
My Vagrantfile can be found here.
Appreciate any advice on solving this error.
ssh vagrant vagrantfile puphpet vagrant-windows
add a comment |
I've been using PuPHPet to create virtual development environments.
Yesterday I generated a config file for a new box. When I try to spin it up using the vagrant up
command, I get the following error message:
C:xx>vagrant up
Bringing machine 'default' up with 'virtualbox'
provider... There are errors in the configuration of this machine.
Please fix the following errors and try again:
SSH:
*private_key_path
file must exist: P://.vagrant.d/insecure_private_key
I came across this question and moved the insecure_private_key from puphpetfilesdotssh to the same directory as where the Vagrantfile is. However this gives the same error.
I'm also confused by the directory given in the error message;
P://.vagrant.d/insecure_private_key
Why is the 'P' drive mentioned?
My Vagrantfile can be found here.
Appreciate any advice on solving this error.
ssh vagrant vagrantfile puphpet vagrant-windows
Can you share yourVagrantfile
?
– Vaibhav Sagar
Apr 16 '15 at 11:30
Updated in question.
– Mr B
Apr 16 '15 at 11:38
add a comment |
I've been using PuPHPet to create virtual development environments.
Yesterday I generated a config file for a new box. When I try to spin it up using the vagrant up
command, I get the following error message:
C:xx>vagrant up
Bringing machine 'default' up with 'virtualbox'
provider... There are errors in the configuration of this machine.
Please fix the following errors and try again:
SSH:
*private_key_path
file must exist: P://.vagrant.d/insecure_private_key
I came across this question and moved the insecure_private_key from puphpetfilesdotssh to the same directory as where the Vagrantfile is. However this gives the same error.
I'm also confused by the directory given in the error message;
P://.vagrant.d/insecure_private_key
Why is the 'P' drive mentioned?
My Vagrantfile can be found here.
Appreciate any advice on solving this error.
ssh vagrant vagrantfile puphpet vagrant-windows
I've been using PuPHPet to create virtual development environments.
Yesterday I generated a config file for a new box. When I try to spin it up using the vagrant up
command, I get the following error message:
C:xx>vagrant up
Bringing machine 'default' up with 'virtualbox'
provider... There are errors in the configuration of this machine.
Please fix the following errors and try again:
SSH:
*private_key_path
file must exist: P://.vagrant.d/insecure_private_key
I came across this question and moved the insecure_private_key from puphpetfilesdotssh to the same directory as where the Vagrantfile is. However this gives the same error.
I'm also confused by the directory given in the error message;
P://.vagrant.d/insecure_private_key
Why is the 'P' drive mentioned?
My Vagrantfile can be found here.
Appreciate any advice on solving this error.
ssh vagrant vagrantfile puphpet vagrant-windows
ssh vagrant vagrantfile puphpet vagrant-windows
edited May 23 '17 at 12:02
Community♦
11
11
asked Apr 16 '15 at 11:16
Mr BMr B
1,71043154
1,71043154
Can you share yourVagrantfile
?
– Vaibhav Sagar
Apr 16 '15 at 11:30
Updated in question.
– Mr B
Apr 16 '15 at 11:38
add a comment |
Can you share yourVagrantfile
?
– Vaibhav Sagar
Apr 16 '15 at 11:30
Updated in question.
– Mr B
Apr 16 '15 at 11:38
Can you share your
Vagrantfile
?– Vaibhav Sagar
Apr 16 '15 at 11:30
Can you share your
Vagrantfile
?– Vaibhav Sagar
Apr 16 '15 at 11:30
Updated in question.
– Mr B
Apr 16 '15 at 11:38
Updated in question.
– Mr B
Apr 16 '15 at 11:38
add a comment |
7 Answers
7
active
oldest
votes
I fixed the problem by replacing the path to insecure_private_key by hard coding the path to the insecure_private_key file.
So it went from:
config.ssh.private_key_path = [
customKey,
"#{ENV['HOME']}/.vagrant.d/insecure_private_key"
]
To:
config.ssh.private_key_path = [
customKey,
"C:/Users/My.User/.vagrant.d/insecure_private_key"
]
It's fixed! Thanks!
– Wes Eklund
Sep 23 '15 at 14:00
add a comment |
It looks like it's because you may have performed a vagrant destroy which deleted the insecure_private_key
.
But the vagrant file looks up the puphpetfilesdotssh files
, if they are there, it looks for the insecure_private_key.
delete (rename)
the id_rsa
files in puphpetfilesdotssh
this fixed it for me!
delete (rename) the id_rsa files in puphpetfilesdotssh worked for me!
– Bo Pennings
Aug 19 '15 at 9:58
add a comment |
You can also just delete all the files in the puphpet folder rm -rf puphpet/files/dot/ssh/*
and the vm should regenerate them when you run vagrant provision.
add a comment |
I'm not sure what's wrong with your Vagrant installation, but this line:
vagrant_home = (ENV['VAGRANT_HOME'].to_s.split.join.length > 0) ? ENV['VAGRANT_HOME'] : "#{ENV['HOME']}/.vagrant.d"
is what sets up the variable that is later on used here:
config.ssh.private_key_path = [
customKey,
"#{vagrant_home}/insecure_private_key"
]
The reason this is happening is that as of Vagrant 1.7, it generates a unique private key for each VM you have. There's, what I consider to be, a bug in that Vagrant completely ignores user-defined private_key_path
if it detects that it generated a unique key previously.
What PuPHPet is doing here is letting Vagrant generate its unique SSH key, then once the VM boots up and has SSH access, it goes in and generates another key to replace it.
The reason we're replacing it is because this new Vagrant feature only works on OSX/Linux hosts, due to Windows not having the required tools.
My way works across all OS because it does the SSH key generation within the VM itself.
All this is semi-related to your question, but the answer is that something's wrong with your Vagrant installation if those environment variables have not been defined.
Thanks for the info. I did upgrade my version of Vagrant but to no avail.
– Mr B
Apr 17 '15 at 8:44
add a comment |
When you are sharing your puphet configuration to your teammates, hardcoding the private_key_path is not advisable as per the accepted answer.
My host computer is windows so i have added a new environment variable VAGRANT_HOME with value %USERPROFILE% since this is where my /.vagrant.d folder resides. When you add this variable just make sure that you close command prompts that are open so the variable will be applied
Hope this helps
add a comment |
Adding to PunctuationMark's answer you can also set the VAGRANT_HOME environment variable in your Vagrantfile: ENV['VAGRANT_HOME'] = ENV['USERPROFILE']
add a comment |
Editing this following line in Vagrantfile worked for me.
PRIVATE_KEY_SOURCE = '~/.vagrant.d/insecure_private_key'
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f29673065%2fhow-to-fix-vagrant-error-private-key-path-file-must-exist%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
7 Answers
7
active
oldest
votes
7 Answers
7
active
oldest
votes
active
oldest
votes
active
oldest
votes
I fixed the problem by replacing the path to insecure_private_key by hard coding the path to the insecure_private_key file.
So it went from:
config.ssh.private_key_path = [
customKey,
"#{ENV['HOME']}/.vagrant.d/insecure_private_key"
]
To:
config.ssh.private_key_path = [
customKey,
"C:/Users/My.User/.vagrant.d/insecure_private_key"
]
It's fixed! Thanks!
– Wes Eklund
Sep 23 '15 at 14:00
add a comment |
I fixed the problem by replacing the path to insecure_private_key by hard coding the path to the insecure_private_key file.
So it went from:
config.ssh.private_key_path = [
customKey,
"#{ENV['HOME']}/.vagrant.d/insecure_private_key"
]
To:
config.ssh.private_key_path = [
customKey,
"C:/Users/My.User/.vagrant.d/insecure_private_key"
]
It's fixed! Thanks!
– Wes Eklund
Sep 23 '15 at 14:00
add a comment |
I fixed the problem by replacing the path to insecure_private_key by hard coding the path to the insecure_private_key file.
So it went from:
config.ssh.private_key_path = [
customKey,
"#{ENV['HOME']}/.vagrant.d/insecure_private_key"
]
To:
config.ssh.private_key_path = [
customKey,
"C:/Users/My.User/.vagrant.d/insecure_private_key"
]
I fixed the problem by replacing the path to insecure_private_key by hard coding the path to the insecure_private_key file.
So it went from:
config.ssh.private_key_path = [
customKey,
"#{ENV['HOME']}/.vagrant.d/insecure_private_key"
]
To:
config.ssh.private_key_path = [
customKey,
"C:/Users/My.User/.vagrant.d/insecure_private_key"
]
answered Jun 4 '15 at 14:45
Mr BMr B
1,71043154
1,71043154
It's fixed! Thanks!
– Wes Eklund
Sep 23 '15 at 14:00
add a comment |
It's fixed! Thanks!
– Wes Eklund
Sep 23 '15 at 14:00
It's fixed! Thanks!
– Wes Eklund
Sep 23 '15 at 14:00
It's fixed! Thanks!
– Wes Eklund
Sep 23 '15 at 14:00
add a comment |
It looks like it's because you may have performed a vagrant destroy which deleted the insecure_private_key
.
But the vagrant file looks up the puphpetfilesdotssh files
, if they are there, it looks for the insecure_private_key.
delete (rename)
the id_rsa
files in puphpetfilesdotssh
this fixed it for me!
delete (rename) the id_rsa files in puphpetfilesdotssh worked for me!
– Bo Pennings
Aug 19 '15 at 9:58
add a comment |
It looks like it's because you may have performed a vagrant destroy which deleted the insecure_private_key
.
But the vagrant file looks up the puphpetfilesdotssh files
, if they are there, it looks for the insecure_private_key.
delete (rename)
the id_rsa
files in puphpetfilesdotssh
this fixed it for me!
delete (rename) the id_rsa files in puphpetfilesdotssh worked for me!
– Bo Pennings
Aug 19 '15 at 9:58
add a comment |
It looks like it's because you may have performed a vagrant destroy which deleted the insecure_private_key
.
But the vagrant file looks up the puphpetfilesdotssh files
, if they are there, it looks for the insecure_private_key.
delete (rename)
the id_rsa
files in puphpetfilesdotssh
this fixed it for me!
It looks like it's because you may have performed a vagrant destroy which deleted the insecure_private_key
.
But the vagrant file looks up the puphpetfilesdotssh files
, if they are there, it looks for the insecure_private_key.
delete (rename)
the id_rsa
files in puphpetfilesdotssh
this fixed it for me!
edited May 5 '15 at 11:15
Konrad Krakowiak
10.5k104944
10.5k104944
answered May 5 '15 at 11:11
LyndonLyndon
691
691
delete (rename) the id_rsa files in puphpetfilesdotssh worked for me!
– Bo Pennings
Aug 19 '15 at 9:58
add a comment |
delete (rename) the id_rsa files in puphpetfilesdotssh worked for me!
– Bo Pennings
Aug 19 '15 at 9:58
delete (rename) the id_rsa files in puphpetfilesdotssh worked for me!
– Bo Pennings
Aug 19 '15 at 9:58
delete (rename) the id_rsa files in puphpetfilesdotssh worked for me!
– Bo Pennings
Aug 19 '15 at 9:58
add a comment |
You can also just delete all the files in the puphpet folder rm -rf puphpet/files/dot/ssh/*
and the vm should regenerate them when you run vagrant provision.
add a comment |
You can also just delete all the files in the puphpet folder rm -rf puphpet/files/dot/ssh/*
and the vm should regenerate them when you run vagrant provision.
add a comment |
You can also just delete all the files in the puphpet folder rm -rf puphpet/files/dot/ssh/*
and the vm should regenerate them when you run vagrant provision.
You can also just delete all the files in the puphpet folder rm -rf puphpet/files/dot/ssh/*
and the vm should regenerate them when you run vagrant provision.
answered Dec 19 '15 at 21:00
styksstyks
1,2791233
1,2791233
add a comment |
add a comment |
I'm not sure what's wrong with your Vagrant installation, but this line:
vagrant_home = (ENV['VAGRANT_HOME'].to_s.split.join.length > 0) ? ENV['VAGRANT_HOME'] : "#{ENV['HOME']}/.vagrant.d"
is what sets up the variable that is later on used here:
config.ssh.private_key_path = [
customKey,
"#{vagrant_home}/insecure_private_key"
]
The reason this is happening is that as of Vagrant 1.7, it generates a unique private key for each VM you have. There's, what I consider to be, a bug in that Vagrant completely ignores user-defined private_key_path
if it detects that it generated a unique key previously.
What PuPHPet is doing here is letting Vagrant generate its unique SSH key, then once the VM boots up and has SSH access, it goes in and generates another key to replace it.
The reason we're replacing it is because this new Vagrant feature only works on OSX/Linux hosts, due to Windows not having the required tools.
My way works across all OS because it does the SSH key generation within the VM itself.
All this is semi-related to your question, but the answer is that something's wrong with your Vagrant installation if those environment variables have not been defined.
Thanks for the info. I did upgrade my version of Vagrant but to no avail.
– Mr B
Apr 17 '15 at 8:44
add a comment |
I'm not sure what's wrong with your Vagrant installation, but this line:
vagrant_home = (ENV['VAGRANT_HOME'].to_s.split.join.length > 0) ? ENV['VAGRANT_HOME'] : "#{ENV['HOME']}/.vagrant.d"
is what sets up the variable that is later on used here:
config.ssh.private_key_path = [
customKey,
"#{vagrant_home}/insecure_private_key"
]
The reason this is happening is that as of Vagrant 1.7, it generates a unique private key for each VM you have. There's, what I consider to be, a bug in that Vagrant completely ignores user-defined private_key_path
if it detects that it generated a unique key previously.
What PuPHPet is doing here is letting Vagrant generate its unique SSH key, then once the VM boots up and has SSH access, it goes in and generates another key to replace it.
The reason we're replacing it is because this new Vagrant feature only works on OSX/Linux hosts, due to Windows not having the required tools.
My way works across all OS because it does the SSH key generation within the VM itself.
All this is semi-related to your question, but the answer is that something's wrong with your Vagrant installation if those environment variables have not been defined.
Thanks for the info. I did upgrade my version of Vagrant but to no avail.
– Mr B
Apr 17 '15 at 8:44
add a comment |
I'm not sure what's wrong with your Vagrant installation, but this line:
vagrant_home = (ENV['VAGRANT_HOME'].to_s.split.join.length > 0) ? ENV['VAGRANT_HOME'] : "#{ENV['HOME']}/.vagrant.d"
is what sets up the variable that is later on used here:
config.ssh.private_key_path = [
customKey,
"#{vagrant_home}/insecure_private_key"
]
The reason this is happening is that as of Vagrant 1.7, it generates a unique private key for each VM you have. There's, what I consider to be, a bug in that Vagrant completely ignores user-defined private_key_path
if it detects that it generated a unique key previously.
What PuPHPet is doing here is letting Vagrant generate its unique SSH key, then once the VM boots up and has SSH access, it goes in and generates another key to replace it.
The reason we're replacing it is because this new Vagrant feature only works on OSX/Linux hosts, due to Windows not having the required tools.
My way works across all OS because it does the SSH key generation within the VM itself.
All this is semi-related to your question, but the answer is that something's wrong with your Vagrant installation if those environment variables have not been defined.
I'm not sure what's wrong with your Vagrant installation, but this line:
vagrant_home = (ENV['VAGRANT_HOME'].to_s.split.join.length > 0) ? ENV['VAGRANT_HOME'] : "#{ENV['HOME']}/.vagrant.d"
is what sets up the variable that is later on used here:
config.ssh.private_key_path = [
customKey,
"#{vagrant_home}/insecure_private_key"
]
The reason this is happening is that as of Vagrant 1.7, it generates a unique private key for each VM you have. There's, what I consider to be, a bug in that Vagrant completely ignores user-defined private_key_path
if it detects that it generated a unique key previously.
What PuPHPet is doing here is letting Vagrant generate its unique SSH key, then once the VM boots up and has SSH access, it goes in and generates another key to replace it.
The reason we're replacing it is because this new Vagrant feature only works on OSX/Linux hosts, due to Windows not having the required tools.
My way works across all OS because it does the SSH key generation within the VM itself.
All this is semi-related to your question, but the answer is that something's wrong with your Vagrant installation if those environment variables have not been defined.
answered Apr 16 '15 at 22:46
Juan TreminioJuan Treminio
1,9981226
1,9981226
Thanks for the info. I did upgrade my version of Vagrant but to no avail.
– Mr B
Apr 17 '15 at 8:44
add a comment |
Thanks for the info. I did upgrade my version of Vagrant but to no avail.
– Mr B
Apr 17 '15 at 8:44
Thanks for the info. I did upgrade my version of Vagrant but to no avail.
– Mr B
Apr 17 '15 at 8:44
Thanks for the info. I did upgrade my version of Vagrant but to no avail.
– Mr B
Apr 17 '15 at 8:44
add a comment |
When you are sharing your puphet configuration to your teammates, hardcoding the private_key_path is not advisable as per the accepted answer.
My host computer is windows so i have added a new environment variable VAGRANT_HOME with value %USERPROFILE% since this is where my /.vagrant.d folder resides. When you add this variable just make sure that you close command prompts that are open so the variable will be applied
Hope this helps
add a comment |
When you are sharing your puphet configuration to your teammates, hardcoding the private_key_path is not advisable as per the accepted answer.
My host computer is windows so i have added a new environment variable VAGRANT_HOME with value %USERPROFILE% since this is where my /.vagrant.d folder resides. When you add this variable just make sure that you close command prompts that are open so the variable will be applied
Hope this helps
add a comment |
When you are sharing your puphet configuration to your teammates, hardcoding the private_key_path is not advisable as per the accepted answer.
My host computer is windows so i have added a new environment variable VAGRANT_HOME with value %USERPROFILE% since this is where my /.vagrant.d folder resides. When you add this variable just make sure that you close command prompts that are open so the variable will be applied
Hope this helps
When you are sharing your puphet configuration to your teammates, hardcoding the private_key_path is not advisable as per the accepted answer.
My host computer is windows so i have added a new environment variable VAGRANT_HOME with value %USERPROFILE% since this is where my /.vagrant.d folder resides. When you add this variable just make sure that you close command prompts that are open so the variable will be applied
Hope this helps
answered Mar 11 '16 at 11:30
PunctuationMarkPunctuationMark
7011
7011
add a comment |
add a comment |
Adding to PunctuationMark's answer you can also set the VAGRANT_HOME environment variable in your Vagrantfile: ENV['VAGRANT_HOME'] = ENV['USERPROFILE']
add a comment |
Adding to PunctuationMark's answer you can also set the VAGRANT_HOME environment variable in your Vagrantfile: ENV['VAGRANT_HOME'] = ENV['USERPROFILE']
add a comment |
Adding to PunctuationMark's answer you can also set the VAGRANT_HOME environment variable in your Vagrantfile: ENV['VAGRANT_HOME'] = ENV['USERPROFILE']
Adding to PunctuationMark's answer you can also set the VAGRANT_HOME environment variable in your Vagrantfile: ENV['VAGRANT_HOME'] = ENV['USERPROFILE']
answered May 2 '17 at 18:16
KonradKonrad
315
315
add a comment |
add a comment |
Editing this following line in Vagrantfile worked for me.
PRIVATE_KEY_SOURCE = '~/.vagrant.d/insecure_private_key'
add a comment |
Editing this following line in Vagrantfile worked for me.
PRIVATE_KEY_SOURCE = '~/.vagrant.d/insecure_private_key'
add a comment |
Editing this following line in Vagrantfile worked for me.
PRIVATE_KEY_SOURCE = '~/.vagrant.d/insecure_private_key'
Editing this following line in Vagrantfile worked for me.
PRIVATE_KEY_SOURCE = '~/.vagrant.d/insecure_private_key'
edited Nov 29 '18 at 6:42
Pradeep
8,284102031
8,284102031
answered Nov 29 '18 at 6:35
Paromita SenguptaParomita Sengupta
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f29673065%2fhow-to-fix-vagrant-error-private-key-path-file-must-exist%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Can you share your
Vagrantfile
?– Vaibhav Sagar
Apr 16 '15 at 11:30
Updated in question.
– Mr B
Apr 16 '15 at 11:38