Problem create VZ whitch pvectl vzcreate, on proxmox ve 1.3

reloaded

Member
Aug 25, 2009
69
0
6
Good morning,

I'm trying to create a virtual machine from ssh, it all works well, the machine is created with the template that I order.

But the problem I have to tell you the root password.

As I enter it? plain text? md5? as we are trying to do, but how do I say will not let us enter the virtual machine with the password entered.


Here's an example:


/ usr / bin / ssh-t-t-n-o BatchMode XXX.XXX.XXX.XXX = yes / usr / bin / pvectl vzcreate 220 - disk 10 - ostemplate centos.tar.gz - rootpasswd asdf123 -- hostname host10 - nameserver xx.xx.xx.xx - nameserver xx.xx.xx.xx - searchdomain mydomain.net - onboot yes - ipset XXX.XXX.XXX.XXX - swap 512 - mem 128 - CPUs 1

I tried putting asdf123, 'asdf123' and md5 but no works by accessing the machine.


I appreciate your help
 
Thank you very much for your response.

We used the function crypt ("123456") in php5 and we returned $1$922.cj1. $FJDG7ba/O6XzaUfN5FHyW1 however indicates that Proxmox is: $ 1 $ 8PO3hK+L$Vl7fJCHvko1u5zBJ/iT2M0 we are doing wrong?

thanks again.
 
Hi,

We are creating the passwords from another php, once created the copy and paste in:

/ Usr / bin / ssh-ttno BatchMode XXX.XXX.XXX.XXX = yes / usr / bin / pvectl vzcreate 220 - disk 10 - ostemplate centos.tar.gz - rootpasswd asdf123 - hostname host10 - nameserver xx.xx.xx . xx - nameserver xx.xx.xx.xx - searchdomain mydomain.net - onboot yes - ipset XXX.XXX.XXX.XXX - swap 512 - mem 128 - CPUs 1

and does not work, if we create a password and log Proxmox rescued from, for example: 123456 = $1$YBWEgHrz$C5B8wS3RwgJuZyjlUxfv31

put it in the code and does not work, when that password, the Proxmox created to create a virtual machine with password 123456

Thanks for all the help
 
The pvectl command simply writes the password to /etc/shadow inside the VM - Your VM need to be configured to use shadow passwords.
 
and does not work, if we create a password and log Proxmox rescued from, for example: 123456 = $1$YBWEgHrz$C5B8wS3RwgJuZyjlUxfv31

Just tested that here - works without problems. maybe you just forgot to quote the passsword in the command (use single quotes '$1$YBWEgHrz$C5B8wS3RwgJuZyjlUxfv31' to prevent the shell to substitute variables).
 
hello , this example is correct?

/usr/bin/ssh -t -t -n -o BatchMode=yes 91.11.101.6 /usr/bin/pvectl vzcreate 200 --disk 8 --ostemplate centos-5-standard_5.2-1_i386.tar.gz --rootpasswd '$1$YBWEgHrz$C5B8wS3RwgJuZyjlUxfv31' --hostname test.domain.net --nameserver 22.16.33.99 --nameserver 87.8.230.22 --searchdomain mydomain.net --onboot no --swap 512 --ipset 99.3.103.165 --mem 512 --cpus 1

I'm trying to do with this example but I do not work, I am doing wrong? I believe the machine with all correct values unless the password

Thanks you for all
 
Last edited:
I'm trying to do with this example but I do not work, I am doing wrong? I believe the machine with all correct values unless the password

So whats the content of /etc/passwd and /etc/shadow (inside the VM you created)?
 
etc/passwd

root:x:0:0:root:/root:/bin/bash

etc/shadow

root:--hostname:14382:0:99999:7:::


The code is:

# /usr/bin/ssh -t -t -n -o BatchMode=yes 91.21.11.26 /usr/bin/pvectl vzcreate 200 --disk 6 --ostemplate ubuntu-8.04-x86_64.tar.gz --rootpasswd '$1$YBWEgHrz$C5B8wS3RwgJuZyjlUxfv31' --hostname virt200.unelink.net --nameserver 213.186.33.99 --nameserver 87.98.230.202 --searchdomain unelink.net --onboot yes --ipset 94.23.106.165 --swap 128 --mem 128 --cpus 1


thanks for all
 
It is just a matter of correct shell quoting. It's a bit difficult, because you need to quote paramteres twice, because they get first passed to ssh, and then ssh passes the paramaters again to a shell.

try:

# /usr/bin/ssh -t -t -n -o BatchMode=yes 91.21.11.26 /usr/bin/pvectl vzcreate 200 --disk 6 --ostemplate ubuntu-8.04-x86_64.tar.gz --rootpasswd \''$1$YBWEgHrz$C5B8wS3RwgJuZyjlUxfv31'\' --hostname virt200.unelink.net --nameserver 213.186.33.99 --nameserver 87.98.230.202 --searchdomain unelink.net --onboot yes --ipset 94.23.106.165 --swap 128 --mem 128 --cpus 1
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!