pct exec with parameters

YAGA

Renowned Member
Feb 15, 2016
76
8
73
58
Hello,

I would like to execute a simple command to modify the timezone (with a redirection) inside a LXC container.

Code:
ssh root@192.168.1.2 pct exec 101 "-- echo Europe/Paris > /etc/timezone"

This command changes the timezone in the physical server (IP 192.168.1.2) and not inside the LXC container (ID 101).

Do you have a solution for this issue?

Regards,
YA
 
  • Like
Reactions: Zaman
Thanks for your answer, you probably meant lxc-attach instead pct-attach

I've found a solution for setting up a container from outside the physical machine.

Code:
ssh root@192.168.1.2 "pct exec 101-- bash -c 'echo "Europe/Paris" > /etc/timezone'"

Probably a simpler solution might exist.

Regards,
YA
 
Thanks for your answer, you probably meant lxc-attach instead pct-attach

I've found a solution for setting up a container from outside the physical machine.

Code:
ssh root@192.168.1.2 "pct exec 101-- bash -c 'echo "Europe/Paris" > /etc/timezone'"

Probably a simpler solution might exist.

Regards,
YA
Other simple solution:

Code:
ssh root@192.168.1.2 'echo "echo "Europe/Paris" > /etc/timezone" | pct enter 101'
 

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!