···11+Copyright (c) 2025 Tsiry Sandratraina <tsiry.sndr@rocksky.app>
22+33+Mozilla Public License, version 2.0
44+55+1. Definitions
66+77+1.1. "Contributor"
88+99+ means each individual or legal entity that creates, contributes to the
1010+ creation of, or owns Covered Software.
1111+1212+1.2. "Contributor Version"
1313+1414+ means the combination of the Contributions of others (if any) used by a
1515+ Contributor and that particular Contributor's Contribution.
1616+1717+1.3. "Contribution"
1818+1919+ means Covered Software of a particular Contributor.
2020+2121+1.4. "Covered Software"
2222+2323+ means Source Code Form to which the initial Contributor has attached the
2424+ notice in Exhibit A, the Executable Form of such Source Code Form, and
2525+ Modifications of such Source Code Form, in each case including portions
2626+ thereof.
2727+2828+1.5. "Incompatible With Secondary Licenses"
2929+ means
3030+3131+ a. that the initial Contributor has attached the notice described in
3232+ Exhibit B to the Covered Software; or
3333+3434+ b. that the Covered Software was made available under the terms of
3535+ version 1.1 or earlier of the License, but not also under the terms of
3636+ a Secondary License.
3737+3838+1.6. "Executable Form"
3939+4040+ means any form of the work other than Source Code Form.
4141+4242+1.7. "Larger Work"
4343+4444+ means a work that combines Covered Software with other material, in a
4545+ separate file or files, that is not Covered Software.
4646+4747+1.8. "License"
4848+4949+ means this document.
5050+5151+1.9. "Licensable"
5252+5353+ means having the right to grant, to the maximum extent possible, whether
5454+ at the time of the initial grant or subsequently, any and all of the
5555+ rights conveyed by this License.
5656+5757+1.10. "Modifications"
5858+5959+ means any of the following:
6060+6161+ a. any file in Source Code Form that results from an addition to,
6262+ deletion from, or modification of the contents of Covered Software; or
6363+6464+ b. any new file in Source Code Form that contains any Covered Software.
6565+6666+1.11. "Patent Claims" of a Contributor
6767+6868+ means any patent claim(s), including without limitation, method,
6969+ process, and apparatus claims, in any patent Licensable by such
7070+ Contributor that would be infringed, but for the grant of the License,
7171+ by the making, using, selling, offering for sale, having made, import,
7272+ or transfer of either its Contributions or its Contributor Version.
7373+7474+1.12. "Secondary License"
7575+7676+ means either the GNU General Public License, Version 2.0, the GNU Lesser
7777+ General Public License, Version 2.1, the GNU Affero General Public
7878+ License, Version 3.0, or any later versions of those licenses.
7979+8080+1.13. "Source Code Form"
8181+8282+ means the form of the work preferred for making modifications.
8383+8484+1.14. "You" (or "Your")
8585+8686+ means an individual or a legal entity exercising rights under this
8787+ License. For legal entities, "You" includes any entity that controls, is
8888+ controlled by, or is under common control with You. For purposes of this
8989+ definition, "control" means (a) the power, direct or indirect, to cause
9090+ the direction or management of such entity, whether by contract or
9191+ otherwise, or (b) ownership of more than fifty percent (50%) of the
9292+ outstanding shares or beneficial ownership of such entity.
9393+9494+9595+2. License Grants and Conditions
9696+9797+2.1. Grants
9898+9999+ Each Contributor hereby grants You a world-wide, royalty-free,
100100+ non-exclusive license:
101101+102102+ a. under intellectual property rights (other than patent or trademark)
103103+ Licensable by such Contributor to use, reproduce, make available,
104104+ modify, display, perform, distribute, and otherwise exploit its
105105+ Contributions, either on an unmodified basis, with Modifications, or
106106+ as part of a Larger Work; and
107107+108108+ b. under Patent Claims of such Contributor to make, use, sell, offer for
109109+ sale, have made, import, and otherwise transfer either its
110110+ Contributions or its Contributor Version.
111111+112112+2.2. Effective Date
113113+114114+ The licenses granted in Section 2.1 with respect to any Contribution
115115+ become effective for each Contribution on the date the Contributor first
116116+ distributes such Contribution.
117117+118118+2.3. Limitations on Grant Scope
119119+120120+ The licenses granted in this Section 2 are the only rights granted under
121121+ this License. No additional rights or licenses will be implied from the
122122+ distribution or licensing of Covered Software under this License.
123123+ Notwithstanding Section 2.1(b) above, no patent license is granted by a
124124+ Contributor:
125125+126126+ a. for any code that a Contributor has removed from Covered Software; or
127127+128128+ b. for infringements caused by: (i) Your and any other third party's
129129+ modifications of Covered Software, or (ii) the combination of its
130130+ Contributions with other software (except as part of its Contributor
131131+ Version); or
132132+133133+ c. under Patent Claims infringed by Covered Software in the absence of
134134+ its Contributions.
135135+136136+ This License does not grant any rights in the trademarks, service marks,
137137+ or logos of any Contributor (except as may be necessary to comply with
138138+ the notice requirements in Section 3.4).
139139+140140+2.4. Subsequent Licenses
141141+142142+ No Contributor makes additional grants as a result of Your choice to
143143+ distribute the Covered Software under a subsequent version of this
144144+ License (see Section 10.2) or under the terms of a Secondary License (if
145145+ permitted under the terms of Section 3.3).
146146+147147+2.5. Representation
148148+149149+ Each Contributor represents that the Contributor believes its
150150+ Contributions are its original creation(s) or it has sufficient rights to
151151+ grant the rights to its Contributions conveyed by this License.
152152+153153+2.6. Fair Use
154154+155155+ This License is not intended to limit any rights You have under
156156+ applicable copyright doctrines of fair use, fair dealing, or other
157157+ equivalents.
158158+159159+2.7. Conditions
160160+161161+ Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in
162162+ Section 2.1.
163163+164164+165165+3. Responsibilities
166166+167167+3.1. Distribution of Source Form
168168+169169+ All distribution of Covered Software in Source Code Form, including any
170170+ Modifications that You create or to which You contribute, must be under
171171+ the terms of this License. You must inform recipients that the Source
172172+ Code Form of the Covered Software is governed by the terms of this
173173+ License, and how they can obtain a copy of this License. You may not
174174+ attempt to alter or restrict the recipients' rights in the Source Code
175175+ Form.
176176+177177+3.2. Distribution of Executable Form
178178+179179+ If You distribute Covered Software in Executable Form then:
180180+181181+ a. such Covered Software must also be made available in Source Code Form,
182182+ as described in Section 3.1, and You must inform recipients of the
183183+ Executable Form how they can obtain a copy of such Source Code Form by
184184+ reasonable means in a timely manner, at a charge no more than the cost
185185+ of distribution to the recipient; and
186186+187187+ b. You may distribute such Executable Form under the terms of this
188188+ License, or sublicense it under different terms, provided that the
189189+ license for the Executable Form does not attempt to limit or alter the
190190+ recipients' rights in the Source Code Form under this License.
191191+192192+3.3. Distribution of a Larger Work
193193+194194+ You may create and distribute a Larger Work under terms of Your choice,
195195+ provided that You also comply with the requirements of this License for
196196+ the Covered Software. If the Larger Work is a combination of Covered
197197+ Software with a work governed by one or more Secondary Licenses, and the
198198+ Covered Software is not Incompatible With Secondary Licenses, this
199199+ License permits You to additionally distribute such Covered Software
200200+ under the terms of such Secondary License(s), so that the recipient of
201201+ the Larger Work may, at their option, further distribute the Covered
202202+ Software under the terms of either this License or such Secondary
203203+ License(s).
204204+205205+3.4. Notices
206206+207207+ You may not remove or alter the substance of any license notices
208208+ (including copyright notices, patent notices, disclaimers of warranty, or
209209+ limitations of liability) contained within the Source Code Form of the
210210+ Covered Software, except that You may alter any license notices to the
211211+ extent required to remedy known factual inaccuracies.
212212+213213+3.5. Application of Additional Terms
214214+215215+ You may choose to offer, and to charge a fee for, warranty, support,
216216+ indemnity or liability obligations to one or more recipients of Covered
217217+ Software. However, You may do so only on Your own behalf, and not on
218218+ behalf of any Contributor. You must make it absolutely clear that any
219219+ such warranty, support, indemnity, or liability obligation is offered by
220220+ You alone, and You hereby agree to indemnify every Contributor for any
221221+ liability incurred by such Contributor as a result of warranty, support,
222222+ indemnity or liability terms You offer. You may include additional
223223+ disclaimers of warranty and limitations of liability specific to any
224224+ jurisdiction.
225225+226226+4. Inability to Comply Due to Statute or Regulation
227227+228228+ If it is impossible for You to comply with any of the terms of this License
229229+ with respect to some or all of the Covered Software due to statute,
230230+ judicial order, or regulation then You must: (a) comply with the terms of
231231+ this License to the maximum extent possible; and (b) describe the
232232+ limitations and the code they affect. Such description must be placed in a
233233+ text file included with all distributions of the Covered Software under
234234+ this License. Except to the extent prohibited by statute or regulation,
235235+ such description must be sufficiently detailed for a recipient of ordinary
236236+ skill to be able to understand it.
237237+238238+5. Termination
239239+240240+5.1. The rights granted under this License will terminate automatically if You
241241+ fail to comply with any of its terms. However, if You become compliant,
242242+ then the rights granted under this License from a particular Contributor
243243+ are reinstated (a) provisionally, unless and until such Contributor
244244+ explicitly and finally terminates Your grants, and (b) on an ongoing
245245+ basis, if such Contributor fails to notify You of the non-compliance by
246246+ some reasonable means prior to 60 days after You have come back into
247247+ compliance. Moreover, Your grants from a particular Contributor are
248248+ reinstated on an ongoing basis if such Contributor notifies You of the
249249+ non-compliance by some reasonable means, this is the first time You have
250250+ received notice of non-compliance with this License from such
251251+ Contributor, and You become compliant prior to 30 days after Your receipt
252252+ of the notice.
253253+254254+5.2. If You initiate litigation against any entity by asserting a patent
255255+ infringement claim (excluding declaratory judgment actions,
256256+ counter-claims, and cross-claims) alleging that a Contributor Version
257257+ directly or indirectly infringes any patent, then the rights granted to
258258+ You by any and all Contributors for the Covered Software under Section
259259+ 2.1 of this License shall terminate.
260260+261261+5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user
262262+ license agreements (excluding distributors and resellers) which have been
263263+ validly granted by You or Your distributors under this License prior to
264264+ termination shall survive termination.
265265+266266+6. Disclaimer of Warranty
267267+268268+ Covered Software is provided under this License on an "as is" basis,
269269+ without warranty of any kind, either expressed, implied, or statutory,
270270+ including, without limitation, warranties that the Covered Software is free
271271+ of defects, merchantable, fit for a particular purpose or non-infringing.
272272+ The entire risk as to the quality and performance of the Covered Software
273273+ is with You. Should any Covered Software prove defective in any respect,
274274+ You (not any Contributor) assume the cost of any necessary servicing,
275275+ repair, or correction. This disclaimer of warranty constitutes an essential
276276+ part of this License. No use of any Covered Software is authorized under
277277+ this License except under this disclaimer.
278278+279279+7. Limitation of Liability
280280+281281+ Under no circumstances and under no legal theory, whether tort (including
282282+ negligence), contract, or otherwise, shall any Contributor, or anyone who
283283+ distributes Covered Software as permitted above, be liable to You for any
284284+ direct, indirect, special, incidental, or consequential damages of any
285285+ character including, without limitation, damages for lost profits, loss of
286286+ goodwill, work stoppage, computer failure or malfunction, or any and all
287287+ other commercial damages or losses, even if such party shall have been
288288+ informed of the possibility of such damages. This limitation of liability
289289+ shall not apply to liability for death or personal injury resulting from
290290+ such party's negligence to the extent applicable law prohibits such
291291+ limitation. Some jurisdictions do not allow the exclusion or limitation of
292292+ incidental or consequential damages, so this exclusion and limitation may
293293+ not apply to You.
294294+295295+8. Litigation
296296+297297+ Any litigation relating to this License may be brought only in the courts
298298+ of a jurisdiction where the defendant maintains its principal place of
299299+ business and such litigation shall be governed by laws of that
300300+ jurisdiction, without reference to its conflict-of-law provisions. Nothing
301301+ in this Section shall prevent a party's ability to bring cross-claims or
302302+ counter-claims.
303303+304304+9. Miscellaneous
305305+306306+ This License represents the complete agreement concerning the subject
307307+ matter hereof. If any provision of this License is held to be
308308+ unenforceable, such provision shall be reformed only to the extent
309309+ necessary to make it enforceable. Any law or regulation which provides that
310310+ the language of a contract shall be construed against the drafter shall not
311311+ be used to construe this License against a Contributor.
312312+313313+314314+10. Versions of the License
315315+316316+10.1. New Versions
317317+318318+ Mozilla Foundation is the license steward. Except as provided in Section
319319+ 10.3, no one other than the license steward has the right to modify or
320320+ publish new versions of this License. Each version will be given a
321321+ distinguishing version number.
322322+323323+10.2. Effect of New Versions
324324+325325+ You may distribute the Covered Software under the terms of the version
326326+ of the License under which You originally received the Covered Software,
327327+ or under the terms of any subsequent version published by the license
328328+ steward.
329329+330330+10.3. Modified Versions
331331+332332+ If you create software not governed by this License, and you want to
333333+ create a new license for such software, you may create and use a
334334+ modified version of this License if you rename the license and remove
335335+ any references to the name of the license steward (except to note that
336336+ such modified license differs from this License).
337337+338338+10.4. Distributing Source Code Form that is Incompatible With Secondary
339339+ Licenses If You choose to distribute Source Code Form that is
340340+ Incompatible With Secondary Licenses under the terms of this version of
341341+ the License, the notice described in Exhibit B of this License must be
342342+ attached.
343343+344344+Exhibit A - Source Code Form License Notice
345345+346346+ This Source Code Form is subject to the
347347+ terms of the Mozilla Public License, v.
348348+ 2.0. If a copy of the MPL was not
349349+ distributed with this file, You can
350350+ obtain one at
351351+ http://mozilla.org/MPL/2.0/.
352352+353353+If it is not possible or desirable to put the notice in a particular file,
354354+then You may include the notice in a location (such as a LICENSE file in a
355355+relevant directory) where a recipient would be likely to look for such a
356356+notice.
357357+358358+You may add additional accurate notices of copyright ownership.
359359+360360+Exhibit B - "Incompatible With Secondary Licenses" Notice
361361+362362+ This Source Code Form is "Incompatible
363363+ With Secondary Licenses", as defined by
364364+ the Mozilla Public License, v. 2.0.
+128
README.md
···11+# dflybsd-up ≽༏≼
22+33+A convenient CLI tool to quickly spin up DragonflyBSD virtual machines using
44+QEMU with sensible defaults.
55+66+
77+88+## ✨ Features
99+1010+- **⚡ Quick Start**: Launch DragonflyBSD with a single command
1111+- **📥 Automatic ISO Download**: Fetches DragonflyBSD ISO images automatically
1212+ from official mirrors
1313+- **🔢 Version Support**: Specify any DragonflyBSD version (defaults to 6.4.2)
1414+- **🎯 Flexible Input**: Accepts version numbers, local ISO paths, or download
1515+ URLs
1616+- **💾 Smart Caching**: Skips re-downloading already downloaded ISOs
1717+- **🚀 KVM Acceleration**: Leverages KVM for optimal performance
1818+- **🔌 SSH Port Forwarding**: Automatically forwards port 2222 to guest port 22
1919+- **💻 Serial Console**: Direct terminal access without graphical overhead
2020+- **💿 Persistent Storage**: Optional disk image support for persistent
2121+ installations
2222+- **⚙️ Customizable Resources**: Configure CPU, memory, and disk settings
2323+2424+## 📋 Prerequisites
2525+2626+- [Deno](https://deno.com) runtime
2727+- QEMU with KVM support (`qemu-system-x86_64`)
2828+- KVM kernel modules enabled
2929+3030+## 📦 Installation
3131+3232+```bash
3333+deno install -A -g -r -f --config deno.json ./main.ts -n dflybsd-up
3434+```
3535+3636+## 🚀 Usage
3737+3838+### Basic Usage
3939+4040+```bash
4141+# Launch with defaults (DragonflyBSD 6.4.2, 2 CPUs, 2GB RAM)
4242+dflybsd-up
4343+4444+# Specify a version (automatically downloads the RELEASE ISO)
4545+dflybsd-up 6.4.2
4646+4747+# Use a local ISO file
4848+dflybsd-up /path/to/dragonflybsd.iso
4949+5050+# Download from a specific URL
5151+dflybsd-up https://mirror-master.dragonflybsd.org/iso-images/dfly-x86_64-6.4.2_REL.iso
5252+```
5353+5454+### Advanced Options
5555+5656+```bash
5757+# Custom CPU and memory configuration
5858+dflybsd-up --cpu host --cpus 4 --memory 4G
5959+6060+# Specify output path for downloaded ISO
6161+dflybsd-up 6.4.2 --output ~/isos/dragonfly.iso
6262+6363+# Use a persistent disk image
6464+dflybsd-up --drive dragonfly.img --disk-format raw
6565+6666+# Combine options
6767+dflybsd-up 6.4.2 \
6868+ --cpus 4 \
6969+ --memory 8G \
7070+ --drive dragonfly.qcow2 \
7171+ --disk-format qcow2
7272+```
7373+7474+## ⚙️ Options
7575+7676+| Option | Short | Description | Default |
7777+| --------------- | ----- | ------------------------------------ | ----------------------- |
7878+| `--output` | `-o` | Output path for downloaded ISO | Auto-generated from URL |
7979+| `--cpu` | `-c` | CPU type to emulate | `host` |
8080+| `--cpus` | `-C` | Number of CPU cores | `2` |
8181+| `--memory` | `-m` | Amount of memory for VM | `2G` |
8282+| `--drive` | `-d` | Path to VM disk image | None |
8383+| `--disk-format` | | Disk image format (qcow2, raw, etc.) | `raw` |
8484+8585+## 🔢 Version Format
8686+8787+Simply provide the version number (e.g., `6.4.2` or `6.2`), and the tool will
8888+automatically construct the download URL for the corresponding RELEASE ISO.
8989+9090+Examples:
9191+9292+- `6.4.2` → downloads `dfly-x86_64-6.4.2_REL.iso`
9393+- `6.2` → downloads `dfly-x86_64-6.2_REL.iso`
9494+- `7.0` → downloads `dfly-x86_64-7.0_REL.iso`
9595+9696+## 💿 Creating a Persistent Disk
9797+9898+To install DragonflyBSD persistently:
9999+100100+```bash
101101+# Create a disk image
102102+qemu-img create -f qcow2 dragonfly.qcow2 20G
103103+104104+# Launch with the disk attached
105105+dflybsd-up 6.4.2 --drive dragonfly.qcow2 --disk-format qcow2
106106+```
107107+108108+## 🔐 SSH Access
109109+110110+The VM automatically forwards host port 2222 to guest port 22. After configuring
111111+SSH in your DragonflyBSD installation:
112112+113113+```bash
114114+ssh -p 2222 user@localhost
115115+```
116116+117117+## 📄 License
118118+119119+See [LICENSE](LICENSE) file for details.
120120+121121+## 🤝 Contributing
122122+123123+Contributions are welcome! Please feel free to submit issues or pull requests.
124124+125125+> [!NOTE]
126126+>
127127+> This tool is designed for development and testing purposes. For production
128128+> DragonflyBSD deployments, consider using proper installation methods.