@@ -144,7 +144,10 @@ func Cmdline(cfg Config) (string, []string, error) {
144144 // virtio-rng-pci acceralates starting up the OS, according to https://wiki.gentoo.org/wiki/QEMU/Options
145145 args = append (args , "-device" , "virtio-rng-pci" )
146146
147- // Misc devices
147+ // Graphics
148+ if y .Video .Display != "" {
149+ args = append (args , "-display" , y .Video .Display )
150+ }
148151 switch y .Arch {
149152 case limayaml .X8664 :
150153 args = append (args , "-device" , "virtio-vga" )
@@ -157,8 +160,23 @@ func Cmdline(cfg Config) (string, []string, error) {
157160 args = append (args , "-device" , "usb-kbd" )
158161 args = append (args , "-device" , "usb-mouse" )
159162 }
163+
164+ // Parallel
160165 args = append (args , "-parallel" , "none" )
161166
167+ // Serial
168+ serialSock := filepath .Join (cfg .InstanceDir , "serial.sock" )
169+ if err := os .RemoveAll (serialSock ); err != nil {
170+ return "" , nil , err
171+ }
172+ serialLog := filepath .Join (cfg .InstanceDir , "serial.log" )
173+ if err := os .RemoveAll (serialLog ); err != nil {
174+ return "" , nil , err
175+ }
176+ const serialChardev = "char-serial"
177+ args = append (args , "-chardev" , fmt .Sprintf ("socket,id=%s,path=%s,server,nowait,logfile=%s" , serialChardev , serialSock , serialLog ))
178+ args = append (args , "-serial" , "chardev:" + serialChardev )
179+
162180 // We also want to enable vsock and virtfs here, but QEMU does not support vsock and virtfs for macOS hosts
163181
164182 // QEMU process
0 commit comments