[P4-discuss] Setting up the Tutorial VM

He, Mu mu.he at tum.de
Mon Jun 4 12:59:41 EDT 2018


I created my own SSH key pair and reran "vagrant up". Vagrant still threw out the warning message "Vagrant insecure key detected. ".

After googling a little bit, I came up with the following workaround and it works now.

Add one more line

config.ssh.insert_key = false

in the Vagrantfile, which locates in the vm folder. Then run "vagrant up" one more time.

________________________________
From: Nate Foster <jnfoster at cs.cornell.edu>
Sent: Monday, June 4, 2018 3:45:04 PM
To: He, Mu
Cc: p4-discuss at lists.p4.org
Subject: Re: [P4-discuss] Setting up the Tutorial VM

>From the error message, it seems that your SSH key has not been properly set up, and hence Vagrant is refusing to set up the VM.

You can either change the ownership and permissions on this file

/home/sdn/hdd/tutorials/vm/.vagrant/machines/p4-tutorial/virtualbox/private_key

so they are owned by the user running Vagrant and have the right permissions for SSH (see for example https://superuser.com/questions/215504/permissions-on-private-key-in-ssh-folder)

Alternatively, if you generate your own SSH key, you shouldn't have any trouble. To go this route, try the ssh-keygen command-line utility (and see tutorials like this:  https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2)

-N



On Mon, Jun 4, 2018 at 4:41 AM, He, Mu <mu.he at tum.de<mailto:mu.he at tum.de>> wrote:

Hi Nate,


Thanks for your reply. I deleted the VM in virtualbox and tried to set up a new one. Following is the output of "vagrant up".


Bringing machine 'p4-tutorial' up with 'virtualbox' provider...
==> p4-tutorial: Importing base box 'fso/xenial64-desktop'...
==> p4-tutorial: Matching MAC address for NAT networking...
==> p4-tutorial: Checking if box 'fso/xenial64-desktop' is up to date...
==> p4-tutorial: Setting the name of the VM: P4 Tutorial 2018-06-04
==> p4-tutorial: Clearing any previously set network interfaces...
==> p4-tutorial: Preparing network interfaces based on configuration...
    p4-tutorial: Adapter 1: nat
==> p4-tutorial: Forwarding ports...
    p4-tutorial: 22 (guest) => 2222 (host) (adapter 1)
==> p4-tutorial: Running 'pre-boot' VM customizations...
==> p4-tutorial: Booting VM...
==> p4-tutorial: Waiting for machine to boot. This may take a few minutes...
    p4-tutorial: SSH address: 127.0.0.1:2222<http://127.0.0.1:2222>
    p4-tutorial: SSH username: vagrant
    p4-tutorial: SSH auth method: private key
    p4-tutorial:
    p4-tutorial: Vagrant insecure key detected. Vagrant will automatically replace
    p4-tutorial: this with a newly generated keypair for better security.
    p4-tutorial:
    p4-tutorial: Inserting generated public key within guest...
    p4-tutorial: Removing insecure key from the guest if it's present...
    p4-tutorial: Key inserted! Disconnecting and reconnecting using new SSH key...
The private key to connect to the machine via SSH must be owned
by the user running Vagrant. This is a strict requirement from
SSH itself. Please fix the following key to be owned by the user
running Vagrant:

/home/sdn/hdd/tutorials/vm/.vagrant/machines/p4-tutorial/virtualbox/private_key


BR, Mu He



________________________________
From: Nate Foster <jnfoster at cs.cornell.edu<mailto:jnfoster at cs.cornell.edu>>
Sent: Sunday, June 3, 2018 10:40:01 PM
To: He, Mu
Cc: p4-discuss at lists.p4.org<mailto:p4-discuss at lists.p4.org>
Subject: Re: [P4-discuss] Setting up the Tutorial VM

It sounds like the install scripts may not have completed successfully... can you include the output of `vagrant up`?

This is somewhat strange because I *just* used these scripts to build the VM for the 2018 Spring Developer Day last week. So everything should be working.

If you are only interested in getting a VM, you might try to grab the OVA image here: https://drive.google.com/uc?id=1f22-DYlUV33DsR88_MeMb4s7-1NX_ams&export=download

-N

On Sun, Jun 3, 2018 at 3:26 PM, He, Mu <mu.he at tum.de<mailto:mu.he at tum.de>> wrote:

Dear P4-Community,


As I tried to follow the P4 tutorial(https://github.com/p4lang/tutorials) with the provided VM, I encountered a problem.

I installed vagrant and virtualbox; however, after running "vagrant up" in the vm folder, a VM was created and it was logged in automatically without asking any credentials. The user name is "vagrant", and there is no user with the name "p4". Besides, none of the required software is installed.

I wonder how to correctly set up the tutorial VM.

Thank you!


Best regards,

Mu He

_______________________________________________
P4-discuss mailing list
P4-discuss at lists.p4.org<mailto:P4-discuss at lists.p4.org>
http://lists.p4.org/mailman/listinfo/p4-discuss_lists.p4.org



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-discuss_lists.p4.org/attachments/20180604/0d5fe070/attachment.html>


More information about the P4-discuss mailing list