VM Setup with Copy / Paste / SSH-Keys

j.io

Member
Mar 16, 2021
98
6
13
37
Hi,

when setting up a new VM from a blank Linux, one has to set

- root password,
- user password,
- (SSH keys / key files),

as well as copy / pasting some commands or scripts. The copy / paste functionalities of Proxmox unfortunately do not always work as expected. My question to you - what is your best practice to solve such problems? Once the SSH keys are exchanged, most of the problems can be solved by copy / pasting in the terminal and sending the commands / files via SSH.

So far the only thing I see is to set easy passwords, connect via SSH, and change the passwords afterwards ...
 
The copy / paste functionalities of Proxmox unfortunately do not always work as expected.
What do you expect and what is not working in detail? Please provide details.
 
What do you expect and what is not working in detail? Please provide details.
I am using macOS with Safari (latest versions of both).

In Proxmox, I set up the VM and install e.g. Debian via NoVNC. When asked for a root password, I cannot paste from macOS to NoVNC (CMD+v). When wanting to paste SSH keys later in the OS shell the same applies. Copying commands also does not work. If I type them, I cannot type a "pipe" character, no matter what localization and keyboard setup / language set I use (tried them all).

I expect that I can copy any string from macOS to NoVNC running in the Safari browser. Is that expectation wrong?
 
Copy/Paste cannot work with NoVNC, by design.

If you see issues inside, try different Browsers (e.g. Firefox). pipe (and others) should work fine inside a NoVNC console.
 
what is your best practice to solve such problems?
Just to add: If you need copy/paste for VM consoles, you can use SPICE.

But there is no SPICE client for macOS.
 
Just to add: If you need copy/paste for VM consoles, you can use SPICE.

But there is no SPICE client for macOS.
I think there is something. But SPICE is greyed out for VM, seems to work only for the host. What to do about that?
 
I think what you want is to research :
cloud-init https://pve.proxmox.com/wiki/Cloud-Init_Support
cloud images http://cloud.debian.org/images/cloud/
templates https://pve.proxmox.com/wiki/VM_Templates_and_Clones


Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
Well, indeed that is a good tip. Can you tell me how I use that cloud images and deploy them on Proxmox? Which files would I require to start the VM? I only know the procedure for *.iso files.

I found that page: https://pve.proxmox.com/wiki/Cloud-Init_Support#_deploying_cloud_init_templates

However, is there a GUI way of doing that?
 
Last edited:
  • Like
Reactions: j.io
There are two parts:
- Creating VM image from a cloud image. This is done by importing a disk. I dont believe there is UI wizard for it.
- Setting up Cloud Init. Basic options are available in UI, more advanced stuff is done via CLI

https://norocketscience.at/deploy-proxmox-virtual-machines-using-cloud-init/


Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
Thanks, that worked. I do not get the part with the serial console (why is that necessary?).
 
I would suggest you add serial console to your virtual machine. (Hardware -> Add Serial Port).

Then you have to activate it. See:
https://pve.proxmox.com/wiki/Serial_Terminal
https://help.ubuntu.com/community/SerialConsoleHowto#Server_Setup

For Debian 11 is is very easy:
systemctl enable serial-getty@ttyS0.service
systemctl start serial-getty@ttyS0.service

Then instead on noVNC you can open xterm.js -> here you can paste text!
Or you can access the machine from the host with: qm terminal <VMiD>
 
  • Like
Reactions: j.io

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!