← 返回命令列表

Linux command

lxc-profile 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

List

lxc profile list

Show

lxc profile show [profile_name]

Edit

lxc profile edit [profile_name]

Create

lxc profile create [profile_name]

Launch

lxc launch [container_image] [container_name] -p [profile1] -p [profile2]

Change the profiles

lxc profile assign [container_name] [profile1,profile2]

说明

lxc profile manages configuration profiles for LXD containers and virtual machines. Profiles define reusable sets of configuration options including resource limits, device mappings, network settings, and security policies. Containers can use multiple profiles, which are applied in order (later profiles override earlier ones). The default profile is automatically applied to new containers and typically includes basic network and storage configuration. Profile configuration uses YAML format, specifying options like CPU/memory limits, disk quotas, network interfaces, and GPU passthrough.

参数

list
List all available profiles
show _profile_
Display the full configuration of a profile
edit _profile_
Open a profile for editing in the default editor
create _profile_
Create a new empty profile
delete _profile_
Remove a profile
copy _source_ _dest_
Copy a profile to a new name
rename _old_ _new_
Rename a profile
assign _instance_ _profiles_
Set the profiles for an instance (comma-separated list)
add _instance_ _profile_
Add a profile to an instance's existing profiles
remove _instance_ _profile_
Remove a profile from an instance
set _profile_ _key_ _value_
Set a profile configuration key
get _profile_ _key_
Get a profile configuration value
device add _profile_ _device_ _type_ _options_
Add a device to a profile
device remove _profile_ _device_
Remove a device from a profile

FAQ

What is the lxc-profile command used for?

lxc profile manages configuration profiles for LXD containers and virtual machines. Profiles define reusable sets of configuration options including resource limits, device mappings, network settings, and security policies. Containers can use multiple profiles, which are applied in order (later profiles override earlier ones). The default profile is automatically applied to new containers and typically includes basic network and storage configuration. Profile configuration uses YAML format, specifying options like CPU/memory limits, disk quotas, network interfaces, and GPU passthrough.

How do I run a basic lxc-profile example?

Run `lxc profile list` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does list do in lxc-profile?

List all available profiles