Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Libguestfs modifies qcow2 image file

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Libguestfs modifies qcow2 image file

Apt install libguestfs-tools

# guestfish-a / home/lsz/centos7.qcow2

Welcome to guestfish, the guest filesystem shell for

Editing virtual machine filesystems and disk images.

Type: 'help' for help on commands

'man' to read the manual

'quit' to quit the shell

> run

100% ⟦▒ ▒⟧ 00:00

> list-filesystems

/ dev/sda1: xfs

/ dev/centos/root: xfs

/ dev/centos/swap: swap

> mount / dev/centos/root /

> cat / etc/passwd

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

Bin:x:1:1:bin:/bin:/sbin/nologin

Daemon:x:2:2:daemon:/sbin:/sbin/nologin

Adm:x:3:4:adm:/var/adm:/sbin/nologin

Lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin

Sync:x:5:0:sync:/sbin:/bin/sync

Shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown

Halt:x:7:0:halt:/sbin:/sbin/halt

Mail:x:8:12:mail:/var/spool/mail:/sbin/nologin

Operator:x:11:0:operator:/root:/sbin/nologin

Games:x:12:100:games:/usr/games:/sbin/nologin

Ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin

Nobody:x:99:99:Nobody:/:/sbin/nologin

Systemd-network:x:192:192:systemd Network Management:/:/sbin/nologin

Dbus:x:81:81:System message bus:/:/sbin/nologin

Polkitd:x:999:998:User for polkitd:/:/sbin/nologin

Sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin

Postfix:x:89:89::/var/spool/postfix:/sbin/nologin

> unmount /

ASAv adds console:

> mount / dev/sda2 /

> touch / use_ttyS0

> unmount /

> exit

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report