大网数据广告活动
服务器运维问答

Clone a remote Linux server with rsync and migrate it locally as Virtual Machine

· 52CE 我爱测

I have a CentOS6.9 Linux server remotely on a VPS Provider and I need to clone my remote server on my local computer as a Virtual Machine for examination purposes. I made a full server backup without compression to another remote…

问题原文

原帖链接 · Cadmos · CC BY-SA 4.0

I have a CentOS6.9 Linux server remotely on a VPS Provider and I need to clone my remote server on my local computer as a Virtual Machine for examination purposes.


I made a full server backup without compression to another remote server (rsync.net) by using the following rsync command:

rsync -auHxv --numeric-ids --delete-after --progress --exclude="/etc/fstab" --exclude="/dev/*" --exclude="/proc/*" --exclude="/sys/*" --exclude="/tmp/*" --exclude="/boot/*" --exclude="/run/*" --exclude="/mnt/*" --exclude="/media/*" --exclude="/backup/*" --exclude="/lost+found" / -e ssh [email omitted]:backup_directory


Would it be possible to use this backup as an image for cloning through Virtual Machine on my local computer, either by using VMWare Workstation or Virtual Box or any other Virtual Machine Platform ?

已采纳解答

原帖链接 · Joe M · CC BY-SA 4.0

I would use DD over SSH and import that as a new VBox image after conversion. I use GZIP to skip copying gigs of empty space.

ssh root@remoteIP  "dd if=/dev/sda | gzip - " | dd of=image.gz

Uncompress and convert.

gunzip image.gz 
VBoxManage convertdd image image.vdi --format VDI

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-06-04)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。