on main help sign in
feat: removed rust and rename to vibebox
commit197207db76226ea8c5ec51c3d71334b6b608da58 authorrobcholz <84130577+robcholz@users.noreply.github.com> dateFri 6 Feb 2026, 22:12 (8 months ago) parent2c08e29
5 files changed+28−54
docs/tasks.md+2−2 src/instance.rs+21−30 src/lib.rs+1−1 src/provision.sh+2−13 src/vm.rs+2−8
docs/tasks.md+2−2
@@ -36,6 +36,6 @@
3636## Integration
3737
38381. [x] Wire up the vm and tui.
39−2. [ ] Use ssh to connect to vm.
39+2. [x] Use ssh to connect to vm.
40403. [ ] wire up SessionManager.
41−4. [ ] VM should be separated by per-session VM daemon process (only accepts if to shutdown vm and itself).
41+4. [ ] VM should be separated by a per-session VM daemon process (only accepts if to shut down vm and itself).
src/instance.rs+21−30
@@ -1,12 +1,8 @@
11use std::{
2− env,
3− fs,
2+ env, fs,
43 io::{self, Write},
54 net::{SocketAddr, TcpStream},
6− os::unix::{
7− fs::PermissionsExt,
8− io::OwnedFd,
9− },
5+ os::unix::{fs::PermissionsExt, io::OwnedFd},
106 path::{Path, PathBuf},
117 process::{Command, Stdio},
128 sync::{
@@ -17,8 +13,8 @@ use std::{
1713};
1814
1915use serde::{Deserialize, Serialize};
20−use uuid::Uuid;
2116use std::sync::mpsc::Sender;
17+use uuid::Uuid;
2218
2319use crate::{
2420 session_manager::INSTANCE_DIR_NAME,
@@ -30,7 +26,7 @@ const INSTANCE_TOML: &str = "instance.toml";
3026const SSH_KEY_NAME: &str = "ssh_key";
3127const SERIAL_LOG_NAME: &str = "serial.log";
3228const SSH_GUEST_DIR: &str = "/root/.vibebox";
33−const DEFAULT_SSH_USER: &str = "vibebox";
29+const DEFAULT_SSH_USER: &str = "vibecoder";
3430const SSH_CONNECT_RETRIES: usize = 30;
3531const SSH_CONNECT_DELAY_MS: u64 = 500;
3632const SSH_SETUP_SCRIPT: &str = include_str!("ssh.sh");
@@ -76,12 +72,8 @@ pub fn run_with_ssh(
7672 true,
7773 )?];
7874
79− let extra_login_actions = build_ssh_login_actions(
80− &config,
81− &project_name,
82− SSH_GUEST_DIR,
83− SSH_KEY_NAME,
84− );
75+ let extra_login_actions =
76+ build_ssh_login_actions(&config, &project_name, SSH_GUEST_DIR, SSH_KEY_NAME);
8577
8678 vm::run_with_args_and_extras(
8779 args,
@@ -107,7 +99,9 @@ fn ensure_instance_dir(project_root: &Path) -> Result<PathBuf, io::Error> {
10799 Ok(instance_dir)
108100}
109101
110−fn ensure_ssh_keypair(instance_dir: &Path) -> Result<(PathBuf, PathBuf), Box<dyn std::error::Error>> {
102+fn ensure_ssh_keypair(
103+ instance_dir: &Path,
104+) -> Result<(PathBuf, PathBuf), Box<dyn std::error::Error>> {
111105 let private_key = instance_dir.join(SSH_KEY_NAME);
112106 let public_key = instance_dir.join(format!("{SSH_KEY_NAME}.pub"));
113107
@@ -129,12 +123,13 @@ fn ensure_ssh_keypair(instance_dir: &Path) -> Result<(PathBuf, PathBuf), Box<dyn
129123 "-N",
130124 "",
131125 "-f",
132− private_key
133− .to_str()
134− .ok_or("ssh key path not utf-8")?,
126+ private_key.to_str().ok_or("ssh key path not utf-8")?,
135127 "-C",
136128 "vibebox",
137129 ])
130+ .stdin(Stdio::null())
131+ .stdout(Stdio::null())
132+ .stderr(Stdio::inherit())
138133 .status()?;
139134
140135 if !status.success() {
@@ -283,8 +278,7 @@ fn spawn_ssh_io(
283278 let ssh_connected = Arc::new(AtomicBool::new(false));
284279 let ssh_started = Arc::new(AtomicBool::new(false));
285280 let ssh_ready = Arc::new(AtomicBool::new(false));
286− let input_tx_holder: Arc<Mutex<Option<Sender<VmInput>>>> =
287− Arc::new(Mutex::new(None));
281+ let input_tx_holder: Arc<Mutex<Option<Sender<VmInput>>>> = Arc::new(Mutex::new(None));
288282
289283 let instance_path = instance_dir.join(INSTANCE_TOML);
290284 let config_for_output = config.clone();
@@ -415,9 +409,7 @@ fn spawn_ssh_io(
415409 );
416410 break;
417411 }
418− thread::sleep(std::time::Duration::from_millis(
419− SSH_CONNECT_DELAY_MS,
420− ));
412+ thread::sleep(std::time::Duration::from_millis(SSH_CONNECT_DELAY_MS));
421413 continue;
422414 }
423415
@@ -427,9 +419,7 @@ fn spawn_ssh_io(
427419 let status = Command::new("ssh")
428420 .args([
429421 "-i",
430− ssh_key_for_thread
431− .to_str()
432− .unwrap_or(".vibebox/ssh_key"),
422+ ssh_key_for_thread.to_str().unwrap_or(".vibebox/ssh_key"),
433423 "-o",
434424 "IdentitiesOnly=yes",
435425 "-o",
@@ -447,6 +437,9 @@ fn spawn_ssh_io(
447437 "-o",
448438 "ConnectTimeout=5",
449439 ])
440+ .env_remove("LC_CTYPE")
441+ .env_remove("LC_ALL")
442+ // .env_remove("LANG")
450443 .arg(format!("{ssh_user}@{ip}"))
451444 .stdin(Stdio::inherit())
452445 .stdout(Stdio::inherit())
@@ -458,8 +451,7 @@ fn spawn_ssh_io(
458451 ssh_connected_for_thread.store(false, Ordering::SeqCst);
459452 eprintln!("[vibebox] ssh exited with status: {status}");
460453 if let Some(tx) = input_tx_holder_for_thread.lock().unwrap().clone() {
461− let _ =
462− tx.send(VmInput::Bytes(b"systemctl poweroff\n".to_vec()));
454+ let _ = tx.send(VmInput::Bytes(b"systemctl poweroff\n".to_vec()));
463455 }
464456 break;
465457 }
@@ -479,8 +471,7 @@ fn spawn_ssh_io(
479471 ssh_connected_for_thread.store(false, Ordering::SeqCst);
480472 eprintln!("[vibebox] ssh exited with status: {status}");
481473 if let Some(tx) = input_tx_holder_for_thread.lock().unwrap().clone() {
482− let _ =
483− tx.send(VmInput::Bytes(b"systemctl poweroff\n".to_vec()));
474+ let _ = tx.send(VmInput::Bytes(b"systemctl poweroff\n".to_vec()));
484475 }
485476 break;
486477 }
src/lib.rs+1−1
@@ -1,6 +1,6 @@
1+pub mod instance;
12pub mod session_manager;
23pub mod tui;
34pub mod vm;
4−pub mod instance;
55
66pub use session_manager::{SessionError, SessionManager, SessionRecord};
src/provision.sh+2−13
@@ -15,16 +15,10 @@ apt-get install -y --no-install-recommends \
1515 git \
1616 ripgrep \
1717 openssh-server \
18− locales \
1918 sudo
2019
21−# Set hostname to "vibe" so it's clear that you're inside the VM.
22−hostnamectl set-hostname vibe
23−
24−# Locale (fix: setlocale: LC_CTYPE ... UTF-8)
25−sed -i 's/^# *en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
26−locale-gen
27−update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8
20+# Set hostname to "vibebox" so it's clear that you're inside the VM.
21+hostnamectl set-hostname vibebox
2822
2923# SSH: host keys + base config (doesn't depend on runtime user)
3024ssh-keygen -A
@@ -54,11 +48,6 @@ systemctl poweroff
5448sleep 100 # sleep here so that we don't see the login screen flash up before the shutdown.
5549EOF
5650
57−
58−# Install Rust
59−curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --component "rustfmt,clippy"
60−
61−
6251# Install Mise
6352curl https://mise.run | sh
6453echo 'eval "$(~/.local/bin/mise activate bash)"' >> .bashrc
src/vm.rs+2−8
@@ -795,12 +795,7 @@ where
795795 continue;
796796 }
797797
798− match poll_with_wakeup(
799− libc::STDIN_FILENO,
800− wakeup_read.as_raw_fd(),
801− &mut buf,
802− -1,
803− ) {
798+ match poll_with_wakeup(libc::STDIN_FILENO, wakeup_read.as_raw_fd(), &mut buf, -1) {
804799 PollResult::Shutdown | PollResult::Error => break,
805800 PollResult::Spurious => continue,
806801 PollResult::Ready(bytes) => {
@@ -858,8 +853,7 @@ where
858853 wakeup_read.as_raw_fd(),
859854 &mut buf,
860855 100,
861− )
862− {
856+ ) {
863857 PollResult::Shutdown | PollResult::Error => break,
864858 PollResult::Spurious => continue,
865859 PollResult::Ready(bytes) => {