通过下载Ubuntu ova文件在Virtual Box快速安装ubuntu

下载ova文件

到清华源下载:Index of /ubuntu-cloud-images/noble/current/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror

具体来说是这个文件

复制代码
https://mirrors.tuna.tsinghua.edu.cn/ubuntu-cloud-images/noble/current/noble-server-cloudimg-amd64.ova

可以浏览器下,也可以wget下载

Virtual box 导入

下载后,到Virtual box 导入

导入成功

创建和使用网上cd image

这个镜像需要使用网上的image,因此启动后需要执行下面命令

复制代码
sudo apt install cloud-utils

这是Ubuntu下的方法啊!

Create and attach an ISO image

To create an ISO image we'll use the cloud-localds function from the cloud-utils package. On Ubuntu and Debian systems you can install this via apt:

复制代码
sudo apt install cloud-utils

For other operating systems, follow the instructions from the cloud-utils upstream repository.

Additionally, to set up remote access for your machine, you'll need to have a set of SSH keys. To learn more about SSH keys and their generation, refer to SSH/OpenSSH/Keys.

Once these prerequisites are met, you can generate and attach the ISO seed image.

  1. Create a YAML file with password authorization enabled:

Choose between two YAML configurations based on your cloud-init version:

FreeBSD下的操作

安装软件

复制代码
sudo pkg install cdrtools

创建文件

复制代码
skywalk@fb98:~/VirtualBox VMs/ubuntu-noble-24.04-cloudimg-20260826/iso $ cat meta-data 
instance-id: iid-local01
local-hostname: ub86


skywalk@fb98:~/VirtualBox VMs/ubuntu-noble-24.04-cloudimg-20260826/iso $ cat user-data
#cloud-config
# 设置默认用户 ubuntu 的密码
password: "Ubuntu"
chpasswd:
  list: |
    ubuntu:Ubuntu
  expire: False

# 允许 SSH 使用密码登录(默认为 no,必须显式开启)
ssh_pwauth: true

# 可选:确保 sshd 配置被重载
runcmd:
  - [ systemctl, restart, sshd ]

生成cd

复制代码
mkisofs -output seed.iso -volid cidata -joliet -rock user-data meta-data

到VirtualBox里导入这个iso文件,启动的时候,它就会生效,用配置的密码登录即可!

注意,就第一次启动的时候是可以的,如果启动多次,这个密码估计就登不进来了.

登上去立刻改密码!

相关推荐
未济5 天前
linux 配置环境变量
linux
傲世仙尊5 天前
目录即文件-Ext文件系统收尾篇
linux·c语言
虎头金猫5 天前
4K 视频总卡在公网带宽?用 N1 + OpenList 把网盘播放链路重新理顺
运维·服务器·网络·python·容器·beautifulsoup·pandas
_艾伦 耶格尔.5 天前
进程间通信
linux
AI职业加油站5 天前
AI智能体应用工程师证书:政策红利下的职业新风口
大数据·运维·人工智能·学习·职场发展
Liuqy-055 天前
Linux IO编程——静态库、动态库
linux
此冬歌咏5 天前
K8s 节点故障实战:优雅驱逐 31 秒,硬故障 331 秒,以及那个永远 Pending 的 Pod
运维·k8s
彧azz5 天前
Linux 环境下 Redis 学习总结:数据类型、持久化、锁、事务、主从与缓存问题
linux·redis·笔记·学习·面试
-梅5 天前
linux(8) 软硬链接
linux·运维·服务器
AIgorithmGEEK5 天前
[Linux]线程三部曲(上):一个执行流的诞生——从操作系统一路拆到 pthread_create
linux·线程·pid